[Nagiosplug-devel] check_disk_smb problem

J. Casalino J at fairbankscapital.com
Wed Jun 19 18:30:02 CEST 2002


Greetings.

I've been playing with the NetSaint 1.2.9-4 check_disk_smb plugin today.
I noticed the following errant behavior in the WARNING and CRITICAL
notifications.

* If I specify a percentage, the plugin appears to work as designed.  As
soon as I cross the warning threshold percent specified on the
commandline, I receive the warning notification, and as soon as I cross
the critical threshold percent, I receive the critical threshold
notification.

* If I use the M(byte) or G(byte) for warning/critical thresholds, I
never receive a warning -- I go straight to critical no matter what the
warning threshold is set to.

I made some quick modifications to the check_disk_smb plugin to verify
my suspicions, since I didn't know any other way to display whether I
was exiting the script with a warning or critical state.  Watch what
happens here (username and password sanitized):

Using the default values of warning at 85% and critical at 95% I receive
this output:
[root at SLNetSaint plugins-scripts]# check_disk_smb 172.16.2.36 log -u
<username> -p <password>
Disk ok - 3.3G (29%) free on \\172.16.2.36\log

Using the thresholds where I want them, at 70% warning and 90% critical,
I receive the following:
[root at SLNetSaint plugins-scripts]# check_disk_smb 172.16.2.36 log -u
<username> -p <password> -w70 -c90 
WARNING -- Only 3.3G (29%) free on \\172.16.2.36\log

Using a threshold for warning at 3500M and critical at 1000M, I get the
following:
[root at SLNetSaint plugins-scripts]# check_disk_smb 172.16.2.36 log -u
<username> -p <password> -w3500M -c1000M  
CRITICAL -- Only 3.3G (29%) free on \\172.16.2.36\log

Same result if I use 3G and 1G instead of 3500M and 1000M:
[root at SLNetSaint plugins-scripts]# check_disk_smb 172.16.2.36 log -u
<username> -p <password> -w3G -c1G  
CRITICAL -- Only 3.3G (29%) free on \\172.16.2.36\log

But even more interesting, even if I specify 2G and 1G for
warning/critical thresholds respectively, I receive:
[root at SLNetSaint plugins-scripts]# check_disk_smb 172.16.2.36 log -u
<username> -p <password> -w2G -c1G  
CRITICAL -- Only 3.3G (29%) free on \\172.16.2.36\log

I checked the Nagios v1.3 check_disk_smb plugin and it appears that some
of the perl was cleaned up, but the logic is largely the same as the
NetSaint 1.2.9-4 plugin.  If I had any idea where to start with this I
would, but I'm not familiar enough with CVS or perl to feel comfortable
hacking the logic on this one. 

In addition, I'd like to suggest two items for check_disk_smb: 

1) I think that check_disk_smb *should* also report WARNING -- or
CRITICAL -- like the modifications I made above so that it's easier to
troubleshoot warning/critical threshold problems.

2) check_disk_smb currently does not support checking administrative or
hidden shares on servers such as c$, d$, e$, etc... While I don't want
to create a domain admin user just to allow NetSaint/Nagios to check
drive space, it would be quite handy to be able to specify a hidden
share such as log$ in the example above so users wouldn't be able to see
shares they should not have access to.

Thanks!

J. Casalino
Sr. Network Administrator, Fairbanks Capital Corp.
josephc at fairbankscapital.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-plugins.org/archive/devel/attachments/20020619/39518432/attachment.html>


More information about the Devel mailing list