[Nagiosplug-devel] [ nagiosplug-Bugs-3552861 ] check_nt incorrectly calculates percentage values leading to
SourceForge.net
noreply at sourceforge.net
Wed Aug 1 01:32:46 CEST 2012
Bugs item #3552861, was opened at 2012-07-31 16:32
Message generated for change (Tracker Item Submitted) made by calestyo
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=3552861&group_id=29880
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Cálestyo (calestyo)
Assigned to: Nobody/Anonymous (nobody)
Summary: check_nt incorrectly calculates percentage values leading to
Initial Comment:
Hi.
This is from the old / soon to be disabled again Nagios Plugins bug tracker that used to be at Nagios itself.
I've just copied this bug over. I'm not the original reporter and have no idea about the thoughts about this bug.
This used to be: http://tracker.nagios.org/view.php?id=126
--------------------------------------------------------------------------------
mmelin:
--------------------------------------------------------------------------------
This problem was discovered and reproduced when using check_nt against a NSClient++ 0.3.7.493 2009-10-12 checking drive size with USEDDISKSPACE.
When given "-w 98% -c 99%" as WARNING/CRITICAL values, check_nt will not return CRITICAL when disk usage transitions from 98% usage to 99% usage.
This was reproduced and verifed by creating a RAM disk 8 MB in size, then filling it with garbage data to only have 64K bytes free.
At the time of testing, this was the drive statistics as reported by Windows Explorer:
8192512 bytes total size
65536 bytes free
65536 / 8192512 = 0.0079 = 7.9%
First, verification that the Nagios host sees the correct disk and values by using check_nrpe and this NRPE Handler:
USEDDISKSPACE=inject CheckDriveSize ShowAll=long Drive=E:\ MaxWarn=98% MaxCrit=99%
As expected the output is this:
root at support-mon-gbg:~# /opt/plugins/check_nrpe -H 172.16.141.179 -c USEDDISKSPACE
CRITICAL: E:\: Total: 7.81M - Used: 7.75M (99%) - Free: 64K (1%) > critical|'E:\'=99%;98;99;
root at support-mon-gbg:~# echo $?
2
Now for the fun part.
check_nt with 99% critical:
root at support-mon-gbg:~# /opt/plugins/check_nt -H 172.16.141.179 -p 1248 -v USEDDISKSPACE -l E -w 98% -c 99%
E:\ - total: 0.01 Gb - used: 0.01 Gb (99%) - free 0.00 Gb (1%) | 'E:\ Used Space'=0.01Gb;0.01;0.01;0.00;0.01
root at support-mon-gbg:~# echo $?
1
check_nt with 98.99% critical:
root at support-mon-gbg:~# /opt/plugins/check_nt -H 172.16.141.179 -p 1248 -v USEDDISKSPACE -l E -w 98% -c 98.99%
E:\ - total: 0.01 Gb - used: 0.01 Gb (99%) - free 0.00 Gb (1%) | 'E:\ Used Space'=0.01Gb;0.01;0.01;0.00;0.01
root at support-mon-gbg:~# echo $?
2
--
Workaround is to use check_nrpe with CheckDriveSize.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=3552861&group_id=29880
More information about the Devel
mailing list