check_snmp_storage.pl % wrong

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Up2you
Posts: 3
Joined: Wed Dec 02, 2015 9:51 am

check_snmp_storage.pl % wrong

Post 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?
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: check_snmp_storage.pl % wrong

Post by hsmith »

What kind of device are you checking against?
Former Nagios Employee.
me.
Up2you
Posts: 3
Joined: Wed Dec 02, 2015 9:51 am

Re: check_snmp_storage.pl % wrong

Post by Up2you »

Hi,

RedHat & Centos boxes
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: check_snmp_storage.pl % wrong

Post 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%)
Former Nagios Employee
Up2you
Posts: 3
Joined: Wed Dec 02, 2015 9:51 am

Re: check_snmp_storage.pl % wrong

Post 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
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: check_snmp_storage.pl % wrong

Post 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.
Former Nagios Employee
Locked