Ad Widget

Collapse

To find the used disk space and processor load in percentage

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mary nancy
    Senior Member
    • Jul 2005
    • 125

    #1

    To find the used disk space and processor load in percentage

    Hi

    Could someone tell me what is the parameter that can be used to monitor
    used disk space , Processor load etc in percentage.

    Regards,
    Nancy
  • bbrendon
    Senior Member
    • Sep 2005
    • 870

    #2
    Originally posted by mary nancy
    Hi

    Could someone tell me what is the parameter that can be used to monitor
    used disk space , Processor load etc in percentage.
    These are all documented under items in the manual.
    Unofficial Zabbix Expert
    Blog, Corporate Site

    Comment

    • mary nancy
      Senior Member
      • Jul 2005
      • 125

      #3
      The used disk space, Swap space, memory all are in numerals that is in KB. Hence i need to know the parameters that would be used to find in percentage. For eg:- i would like my trigger to send a mail only if the used disk space is more than 75%

      Right now i am using parameters like
      vfs.fs.size
      vm.memory.size
      vfs.fs.size
      proc_num

      All these parameters will give numerals as output I need it in percentage . How do we go about it?

      Comment

      • bbrendon
        Senior Member
        • Sep 2005
        • 870

        #4
        For your sanity, there is no way to get processor load in percentage, that just doesn't make sense. You can get cpu percentages in zabbix, but not disk.

        To get percentages for disk space, you have to make your own custom parameters. I don't have examples for you. You might find them in the forums, or just get creative and come up with some.

        I do agree though, zabbix should have disk space in %. For cpu %, try cpu_util and system.cpu.util. I just grabbed that from the docs.
        Unofficial Zabbix Expert
        Blog, Corporate Site

        Comment

        • jyoung
          Junior Member
          • Mar 2005
          • 13

          #5
          Ugh... where did they go?!

          Disk percentage use to be in Zabbix.

          mode "pfree"

          ex: vfs.fs.size[/,pfree]
          Last edited by jyoung; 14-03-2006, 07:29. Reason: Found Solution

          Comment

          • mary nancy
            Senior Member
            • Jul 2005
            • 125

            #6
            Hi

            I have modified my trigger to be like this:
            ({Host.Unix:vfs.fs.size[/,free].last(0)}/{Host.Unix:vfs.fs.size[/,total].last(0)})*100<20

            This trigger throws an alert when the Free disk space is below 20%.

            The other way to find the Disk space in percentage is by using user parameter with the shell command
            df -k / /var /export/home|awk '{print $5,$6}'

            Thanks a lot to all

            Regards
            Nancy

            Comment

            • schirpich
              Junior Member
              • Mar 2006
              • 3

              #7
              Here is what I did to over come those obsicles. I have several servers with several TB's. Seeing a terabyte in Kb just plain hurt my eyes. I know my servers well enough that percentage is just plain fine. So here's what I did to get Disk space percentages in linux and bsd.
              Code:
              myservername# df -h
              Filesystem                                                Size    Used   Avail Capacity  Mounted on
              /dev/ad8s1a                                               496M     55M    401M    12%    /
              devfs                                                     1.0K    1.0K      0B   100%    /dev
              /dev/ad8s1e                                               3.9G    323M    3.2G     9%    /tmp
              /dev/ad8s1f                                                57G     27G     25G    51%    /usr
              /dev/ad8s1d                                               1.9G    504M    1.3G    28%    /var
              As we all know a simple df -h gives us the above result. Within linux you can chop this up into pieces by rows and columns using "awk" & "sed".

              So basicly here's one of my custom user parameters.
              Code:
              UserParameter=hdpercent[root],df -h | awk '{print $5}' | sed -ne 2p | cut -d"%" -f1
              awk '{print $5}'
              This tells it, from the uppermost left corner of the df -h result to go over 5 columns. Which gives us the "Capacity column".

              sed -ne 2p
              tells it from the top to move down two rows.

              Which gives us 12%, the percentage of used space on my root partition. at the end I have it chop off the % sign with the cut -d"%" -f1

              And that is how I got disk percentages in linux and bsd

              Comment

              • jojo
                Member
                • Jul 2006
                • 57

                #8
                i've been using this command for monitoring disk free space: (Similar)

                basicly:
                greps for any line which ends in /path/to/directory regardless of case (-i)
                grab the fourth column
                and cut the % off at the end so we're left with only a number.

                HTML Code:
                df -h | grep -i /path/to/directory$ | awk '{print $4}' | cut -d"%" -f1
                it will either be that or:

                HTML Code:
                df -h | grep -i /path/to/directory$ | awk '{print $5}' | cut -d"%" -f1
                depending on how your system is set up.

                so try em both

                Comment

                Working...