Page 1 of 1

check_snmp_storage.pl % wrong

Posted: Wed Dec 02, 2015 10:33 am
by Up2you
Hello,

The check seems to consistently return the wrong % disk usage, the bigger the disk the bigger the discrepancy:

snmpdf does fine:
[root@mgt-ada-01]# snmpdf -v 2c -c ************ host
Description size (kB) Used Available Used%
*****************************************************************************
/ 12254384 2407600 9846784 19%
***************************************************************************
/boot 499656 78136 421520 15%
/home 1998672 5108 1993564 0%
/var 12254384 3902820 8351564 31%
---------------------------------------------------------------------------------------

NAGIOS check result:

/dev/shm: 0%used(0MB/938MB) /var: 32%used(3810MB/11967MB) /boot: 16%used(76MB/488MB) /home: 0%used(5MB/1952MB) /: 20%used(2351MB/11967MB) (<80%) : OK


On another host nagios says 88% but df says 94%

anybody come acros this?

Re: check_snmp_storage.pl % wrong

Posted: Wed Dec 02, 2015 12:16 pm
by hsmith
What kind of device are you checking against?

Re: check_snmp_storage.pl % wrong

Posted: Thu Dec 03, 2015 3:31 am
by Up2you
Hi,

RedHat & Centos boxes

Re: check_snmp_storage.pl % wrong

Posted: Thu Dec 03, 2015 2:09 pm
by rkennedy
I do believe that Nagios is calculating properly by rounding up, rather than down which SNMPDF seems to be doing. Here are the results from an analysis I did of the numbers you posted -

Nagios Calculations

Code: Select all

/var 
3810mb / 11967mb = .31837
3901440kb / 12254208kb = .31837 (32%)

/boot
76mb / 488mb = .15573
77824kb / 499712kb = .15573 (16%)
SNMPDF Calculations

Code: Select all

/var
3902820kb / 12254384kb = .31848 (31%)

/boot
78136kb / 499656kb = .15637 (15%)

Re: check_snmp_storage.pl % wrong

Posted: Fri Dec 04, 2015 3:38 am
by Up2you
Hmmm

I believe you are correct

df is rather a pig

The round up gets far worse, df on a host is reporting 94% when it is in fact 88%
astounding :shock:

Thanks for your help

I will be more careful in future & check the facts before posting

Regards

Re: check_snmp_storage.pl % wrong

Posted: Fri Dec 04, 2015 10:05 am
by rkennedy
No problem. It's interesting to see how all of the different calculations work. One other possible factor is how they divide, whether it be by 1024 or 1000, and that introduces a bit more factors.

I'll close this thread out now, but feel free to open a new one if you ever need more assistance.