Menu

#33 check_dns ... what is this gigfree logic?

client-module
open
nobody
None
5
2008-08-24
2008-08-24
Anonymous
No

I frankly disagree with the v1.2 changes...

# v1.2 02/26/04 Alan Premselaar <alien@12inch.com>
#
# added additional criteria to reporting red.
# if filesystem is (x)GB and even though it is 98% used
# if it has (X)GB free, it's not really critical.
# so the logic is, if the size of the filesystem is GB
# and the available space is GB then even 98% full is ok, although
# if the size is GB and the avail is MB then it's critical.

nor, for that matter can I really read that. It seems to say that as long as there is a gig left, it can't go to critical... and I don't see a way to disable that logic.

nor am I even sure it is right..

my $gig_free = ( ($size / GIG > 1) && ($used / GIG > 1) ) if (!$humanform);

so if the FS is bigger than a gig, and more than a gig is used, then gig_free seems to be true

and the panic logic is...

if( $percent >= $panic ) && !$gig_free )
$color = "red";
...

since gig_free is always true, !$gig_free is always
false and you can't panic.!?

Seems pretty important to me... I'll patch it in
my local code... by going back to

if( $percent >= $panic ) {

-Tom (baremetal.com)

Discussion

  • alan premselaar

    alan premselaar - 2008-12-09

    good catch.

    actually, it should be $gig_free = (($size / GIG > 1) && ($avail / GIG > 1)) ...

    the logic is, if the filesystem has more than 1 GB and the amount of available space is more than 1GB then even if the percentage is above the critical threshold, it won't go critical until less than 1GB of free space is available.

    of course that was more applicable 4 years ago when I made the modifications than it is now where most filesystems are (x) GB and space gets used so quickly that hitting 98% (for example) and still having (y) GB free is still critical.

    alan

     
  • tom brown

    tom brown - 2009-01-25

    Sorry that should have been check_disk not check_dns

    I would also suggest that the default df command be changed to "df -P" at least
    on linux machines.

    This does NOT parse:

    [root@gt7 ~]# df
    Filesystem 1K-blocks Used Available Use% Mounted on
    /dev/sda1 9621848 1972760 7160312 22% /
    /dev/sda2 28842780 1150312 26227340 5% /usr
    tmpfs 1881020 0 1881020 0% /dev/shm
    /dev/mapper/vg2-backup
    550144224 550115808 28416 100% /mnt
    /dev/mapper/vg2-backup2
    205392632 178143840 27248792 87% /mnt2
    /dev/mapper/vg2-bigger
    961432904 12526680 948906224 2% /mnt3
    //bct1/C$ 20482840 9506968 10975872 47% /bct1/C
    //bct1/F$ 57665316 8952292 48713024 16% /bct1/F
    //bct1/G$ 40959996 31011020 9948976 76% /bct1/G

    but df -P is fine:

    [root@gt7 ~]# df -P
    Filesystem 1024-blocks Used Available Capacity Mounted on
    /dev/sda1 9621848 1972760 7160312 22% /
    /dev/sda2 28842780 1150312 26227340 5% /usr
    tmpfs 1881020 0 1881020 0% /dev/shm
    /dev/mapper/vg2-backup 550144224 550115808 28416 100% /mnt
    /dev/mapper/vg2-backup2 205392632 178143840 27248792 87% /mnt2
    /dev/mapper/vg2-bigger 961432904 12600524 948832380 2% /mnt3
    //bct1/C$ 20482840 9506968 10975872 47% /bct1/C
    //bct1/F$ 57665316 8952292 48713024 16% /bct1/F
    //bct1/G$ 40959996 31011020 9948976 76% /bct1/G

    it shouldn't be a huge deal to teach the parse to figure out continued lines... but changing to df -P is simpler :)

     

Log in to post a comment.