[ nagiosplug-Bugs-3552861 ] check_nt incorrectly calculates percentage values leading to

SourceForge.net <[email protected]>
Newsgroups gmane.network.nagios.plugins.devel
Message-ID <[email protected]>
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@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@support-mon-gbg:~# echo $?
2

Now for the fun part.

check_nt with 99% critical:

root@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@support-mon-gbg:~# echo $?
1

check_nt with 98.99% critical:

root@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@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

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________________
Nagios Plugin Development Mailing List [email protected]
Unsubscribe at https://lists.sourceforge.net/lists/listinfo/nagiosplug-devel
::: Please include plugins version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.