Ad Widget

Collapse

Size Directory not numerical value

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • malik
    Junior Member
    • Jan 2012
    • 26

    #1

    Size Directory not numerical value

    Hello,

    I try of recovering the size of a directory but it is not recognized as a numerical value by Zabbix server.
    I use a script to execute this command:
    "df-du /share/profiles/user"
    The result of this command is sent to a file and recovers ZABBIX value for display. This value is displayed but I have to set the item as follows:
    "Type of information = Character"

    I can not compared her to another value. Do you have a solution to my problem?
    I try with the key vfs.file.size (item setting) but the status is NOT SUPPORTED
    thank you,
    M.
  • sarou
    Member
    • Feb 2014
    • 30

    #2
    Hi,

    I have the same problem... any idea?

    Comment

    • aib
      Senior Member
      • Jan 2014
      • 1615

      #3
      Originally posted by malik
      I try of recovering the size of a directory but it is not recognized as a numerical value by Zabbix server.
      I use a script to execute this command:
      "df-du /share/profiles/user"
      The result of this command is sent to a file and recovers ZABBIX value for display. This value is displayed but I have to set the item as follows:
      "Type of information = Character"
      Do you mind to show your script?
      May be we can give some advice when we will see what are you doing inside of script?
      Sincerely yours,
      Aleksey

      Comment

      • coreychristian
        Senior Member
        Zabbix Certified Specialist
        • Jun 2012
        • 159

        #4
        Without seeing the script, have you tried both numeric types?

        I have found a lot requires numeric(float) helps with a lot of things.

        Otherwise you can try using awk

        example


        UserParameter=paramname,/path/to/scriptname | awk '{print $$1}'

        Comment

        • aib
          Senior Member
          • Jan 2014
          • 1615

          #5
          He described in first message that he
          try of recovering the size of a directory
          and he created a script for that.

          I am thinking that it can be done more easily
          - add one UserParameter to Zabbix Agent config.
          Code:
          UserParameter=dir_size[*],/usr/bin/du -b $1 | tail -1 | awk '{print $$1;}'
          - add as many items as you need. each one looks like
          Code:
          Key: dir_size["/home/username"]
          But I'm not sure that I understand his goal correctly.
          Because of that I asked him to post the source code of script.
          Sincerely yours,
          Aleksey

          Comment

          • coreychristian
            Senior Member
            Zabbix Certified Specialist
            • Jun 2012
            • 159

            #6
            Originally posted by aib
            He described in first message that he and he created a script for that.

            I am thinking that it can be done more easily
            - add one UserParameter to Zabbix Agent config.
            Code:
            UserParameter=dir_size[*],/usr/bin/du -b $1 | tail -1 | awk '{print $$1;}'
            - add as many items as you need. each one looks like
            Code:
            Key: dir_size["/home/username"]
            But I'm not sure that I understand his goal correctly.
            Because of that I asked him to post the source code of script.
            Sorry wasn't trying to step on your toes, just had run into what looked like values that should work in numeric(unsigned) that worked in numeric float.

            I mentioned the script as I assumed he was doing more then just that command, if that's all the script is doing though, your right that item should work perfectly for him.

            Comment

            • aib
              Senior Member
              • Jan 2014
              • 1615

              #7
              Originally posted by coreychristian
              Sorry wasn't trying to step on your toes, just had run into what looked like values that should work in numeric(unsigned) that worked in numeric float.

              I mentioned the script as I assumed he was doing more then just that command, if that's all the script is doing though, your right that item should work perfectly for him.
              It looks more and more like a telepathic session
              We solving the problem which we almost know nothing.
              We dont' know how script works, how data was stored in text file, how zabbix recover value for display.

              I try to use small steps to solve the problem with help from the creator of thread.

              Don't worry,coreychristian! I understand that you like to help and didn't mean to offend anybody.

              Cheers!
              Sincerely yours,
              Aleksey

              Comment

              Working...