Ad Widget

Collapse

Free disk space in GB item and trigger

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Superkikim
    Junior Member
    • Sep 2011
    • 12

    #1

    Free disk space in GB item and trigger

    I've changed the free disk space item prototype in the windows OS template in order to get GB instead of B.

    I've added "Use custom multiplier" as 0.000000000931322574615478515625

    This is the result of 1/1024/1024/1024

    The command

    Code:
    zabbix_get -s 172.16.10.2 -p 10050 -k "vfs.fs.size[C:,free]"
    returns 5771993088

    5771993088 * 0.000000000931322574615478515625 = 5.37558746338
    I have than changed the trigger prototype:

    Code:
    {Template OS Windows:vfs.fs.size[{#FSNAME},free].last(0)}<5368709120
    5368709120 = 5GB
    I have 12 file systems on that server. A lot with far more than 5GB free space.

    But as soon as I replaced the template with the new triggers, I got alerts for all drives saying free disk space was below 5GB. Obviously wrong.

    My question:

    is the multiplier taken in account in the trigger ? should I put <5 on the trigger ?

    Otherwise, where is my mistake ? I'm lost.
    Last edited by Superkikim; 30-10-2012, 16:09.
  • mbsit
    Senior Member
    • Sep 2012
    • 130

    #2
    is the multiplier taken in account in the trigger ? should I put <5 on the trigger ?
    Of course !

    Bests,
    Grzegorz

    --
    Wdrożenia, usługi IT - Warszawa
    Pozdrawiam
    Grzegorz Grabowski
    ____
    Wdrożenia, szkolenia, umowy serwisowe
    Warszawa - Polska

    Comment

    • Superkikim
      Junior Member
      • Sep 2011
      • 12

      #3
      Well. This does not seem to work either.

      i've made the change, and I've ensure my C: drive has less than 5GB free. I get no alert...

      how can I troubleshoot this ? It does not make sense to me. The multiplier should not be taken in account as the expression for the trigger is

      {sbs.imavox.local:vfs.fs.size[{#FSNAME},free].last(0)}

      Therefore, the result from vfs.fs.size[{#FSNAME},free].last(0) should be in bytes, not in GB.

      I'll try the debug logging.

      Comment

      • mbsit
        Senior Member
        • Sep 2012
        • 130

        #4
        Therefore, the result from vfs.fs.size[{#FSNAME},free].last(0) should be in bytes, not in GB.
        WRONG!

        All data before storing in database is multiply. So, the "last(0)" will return 5 not 5368709120. Read the manual carefully .

        Check the Latest Data and you will see. For debuging do not use discovery, create separate item for test purpose...

        Bests,
        Grzegorz

        --
        Wdrożenia, usługi IT - Warszawa
        Pozdrawiam
        Grzegorz Grabowski
        ____
        Wdrożenia, szkolenia, umowy serwisowe
        Warszawa - Polska

        Comment

        • ufocek
          Senior Member
          • Aug 2006
          • 161

          #5
          Hi,

          Which version of zabbix do you have? In zabbix 2.x you can use unit "GB" in trigger. Please look on manual: http://www.zabbix.com/documentation/...ers/expression -> end of document.

          Comment

          • Superkikim
            Junior Member
            • Sep 2011
            • 12

            #6
            2.0.3.

            Thx for the advice. That was not clear to me.

            I've reset the item to the original state, and I'll try with <5G as a trigger value.

            Comment

            • token
              Junior Member
              • May 2013
              • 8

              #7
              If you want to use percent free space for smaller file systems and the number of GB for larger ones you can use two triggers like this:

              Code:
              {Template OS Linux:vfs.fs.size[{#FSNAME},free].last(0)}<5G&{Template OS Linux:vfs.fs.size[{#FSNAME},total].last(0)}>500G
              
              {Template OS Linux:vfs.fs.size[{#FSNAME},pfree].last(0)}<20&{Template OS Linux:vfs.fs.size[{#FSNAME},total].last(0)}<501G
              For the first one the right hand side of the & evaluates to zero if it is not a big (> 500GB) file system. That suppresses the <5GB trigger.

              This is because at some point 1% becomes huge but before then percent is convenient.

              Comment


              • SalDiaz
                SalDiaz commented
                Editing a comment
                Hi.
                This script is functional for windows servers also?
            • flatrick
              Junior Member
              • Feb 2015
              • 4

              #8
              another solution for the trigger

              If you think that 20% on really large volumes might trigger way to many warnings, my solution is to add a check on how much actual space there is left.

              My Trigger Prototype looks like this:

              {Template OS Windows:vfs.fs.size[{#FSNAME},pfree].min(120m)}<20 and {Template OS Windows:vfs.fs.size[{#FSNAME},free].last()}<50G

              This way, the trigger is only true if the volume has less then 50GB of free space and is under 20% of the volumes total space.

              And that min(120m) is just so I don't get any warnings when the server has huge temporary files, 2 hours ought to be enough for backup-jobs and such to complete and clean up after them :-)

              Comment

              • dhcolesj
                Junior Member
                • Mar 2021
                • 5

                #9
                I know this is an old thread but would something like this work?

                Code:
                (({AIXVIP:vfs.fs.size[{#MOUNTDIR},pfree].last()}<20 and {AIXVIP:vfs.fs.size[{#MOUNTDIR},total].last()}<500G) or
                ({AIXVIP:vfs.fs.size[{#MOUNTDIR},pfree].last()}<10 and {AIXVIP:vfs.fs.size[{#MOUNTDIR},total].last()}>=500G and {DG_AIXVIP:vfs.fs.size[{#MOUNTDIR},total].last()}<1T) or
                ({AIXVIP:vfs.fs.size[{#MOUNTDIR},pfree].last()}<5 and {AIXVIP:vfs.fs.size[{#MOUNTDIR},total].last()}>1T))
                ​​​​​​​
                I created my own Discovery rule, and a python script which adds Volume Group, and Logical Volume names to the macros, I can then filter out vgs with a name ending in _vg, or include ONLY vgs with that ending, so that monitoring cluster file systems are easy. (I setup 2 rules 1 for base nodes, and one for VIPs or Cluster Virtual nodes). The macros above then work.

                The question is about the logic. i.e.:
                IF the volume is less than 500G alert on 20% or less free space,
                elseif the volume is 500G or greater, and less than 1T alert on 10% or less free space,
                elseif the volume is 1T or greater alert on 5% free space.

                these are not final agreed upon #s, just logic test sizes.

                Comment

                • apachi
                  Junior Member
                  • May 2018
                  • 10

                  #10
                  i want this triger and item for new zabbix 5.4
                  please help

                  Comment

                  • data21
                    Junior Member
                    • Feb 2022
                    • 1

                    #11
                    Hey guys,

                    I'm curious to get your opinions on this.
                    • Are you monitoring the free disk space of your servers using % or GB ?
                    • What are your thresholds set for warnings and critical alerts on your production servers for free disk space ?

                    A bit of background : We currently use PRTG to monitor our infrastructure. PRTG was deployed using default values/thresholds, which throw a warning for any disk with less than 25% free disk space and crtitical for anything below 10%. Management likes these thresholds because they are simple to understand.

                    I disagree with these thresholds and I am more into micro-management of each server/service. Granted, we have about 60 servers, which is still easy to manage. I believe each server should be analyzed and instead of using % free, we use GB free. The problem that I have with % is that if the disk is increased, the alert will trigger sooner, but that does not mean that it should be triggered.

                    Are there any advantages of using % over GB ? Because I don't see much advantages...

                    Thanks !

                    Comment


                    • andregvn
                      andregvn commented
                      Editing a comment
                      Hi i am newbie on Zabbix. Can you help me to setup alert Disk C when remaining space 20%
                  Working...