Page 1 of 1

Check Disks on Windows Server

Posted: Mon Mar 30, 2015 8:33 am
by htel
We have the following command configured to check the disk space of all drives apart from the c drive (we have a separate command for the c (system) drive).
Command view
$USER1$/check_nrpe -H $HOSTADDRESS$ -c CheckDriveSize -a $ARG1$ $ARG2$ $ARG3$

Arg1= MaxWarn=10G
Arg2= MaxCrit=5G
Arg3= FilterType=Fixed CheckAllOthers Drive=C:

Based on the variety of information from Nagios and NSClient++ the above command should return the diskspace for all drives on a server excluding the c drive.
However, when testing the command from the web interface the below is returned:
COMMAND: /usr/local/nagios/libexec/check_nrpe -H <hostname> -c CheckDriveSize -a MaxWarn=10G MaxCrit=5G FilterType=FIXED CheckAllOthers Drive=C:
OUTPUT: CRITICAL C:: Total: 49.656GB - Used: 32.185GB (65%) - Free: 17.471GB (35%)|'C: used'=32.18547GB;10;5;0;49.65624 'C: used %'=64%;20;10;0;100

If I remove the Drive=C: we can see all drives:
COMMAND: /usr/local/nagios/libexec/check_nrpe -H htv440650 -c CheckDriveSize -a MaxWarn=10G MaxCrit=5G FilterType=FIXED CheckAllOthers
OUTPUT: CRITICAL C:\: Total: 49.656GB - Used: 32.186GB (65%) - Free: 17.47GB (35%), E:\: Total: 299.998GB - Used: 248.296GB (83%) - Free: 51.702GB (17%), F:\: Total: 599.873GB - Used: 297.601GB (50%) - Free: 302.272GB (50%), G:\: Total: 1.99TB - Used: 1.637TB (83%) - Free: 361.48GB (17%), H:\: Total: 1.221TB - Used: 970.921GB (78%) - Free: 278.951GB (22%), I:\: Total: 349.873GB - Used: 161.326GB (47%) - Free: 188.547GB (53%)

Please advise if it is possible to check a windows server drives while ignoring the c: drive.
Many thanks.

Re: Check Disks on Windows Server

Posted: Mon Mar 30, 2015 11:32 am
by lmiltchev
I don't think CheckDriveSize works as intended with "CheckAllOthers"... I was able to recreate the issue. Instead of excluding the drive and showing the "other" drives, the check actually shows it.

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H x.x.x.x -c CheckDriveSize -a MaxWarn=10G MaxCrit=5G FilterType=FIXED
CRITICAL C:\: Total: 452.957GB - Used: 363.326GB (81%) - Free: 89.631GB (19%), D:\: Total: 232.879GB - Used: 62.93GB (28%) - Free: 169.949GB (72%), : Total: 12.762GB - Used: 7.385GB (58%) - Free: 5.376GB (42%)|'C:\ used'=363.32568GB;10;5;0;452.95702 'C:\ used %'=80%;2;1;0;100 'D:\ used'=62.93GB;10;5;0;232.8789 'D:\ used %'=27%;4;2;0;100 '\\?\Volume{4d36d4c6-efab-11e0-a8e7-806e6f6e6963}\ used'=7.38541GB;10;5;0;12.76171 '\\?\Volume{4d36d4c6-efab-11e0-a8e7-806e6f6e6963}\ used %'=57%;78;39;0;100

Code: Select all

 /usr/local/nagios/libexec/check_nrpe -H x.x.x.x -c CheckDriveSize -a MaxWarn=10G MaxCrit=5G FilterType=FIXED CheckAllOthers Drive=C:
CRITICAL C:: Total: 452.957GB - Used: 363.326GB (81%) - Free: 89.631GB (19%)|'C: used'=363.32569GB;10;5;0;452.95702 'C: used %'=80%;2;1;0;100

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H x.x.x.x -c CheckDriveSize -a MaxWarn=10G MaxCrit=5G FilterType=FIXED CheckAllOthers Drive=D:
CRITICAL D:: Total: 232.879GB - Used: 62.93GB (28%) - Free: 169.949GB (72%)|'D: used'=62.93GB;10;5;0;232.8789 'D: used %'=27%;4;2;0;100
I would recommend posting a question on the NSClient++ support forum. Hopefully, the NSClient++ developer wll shed some light on the issue. I don't think he is confident this option even works...
Check all fixed and network drives but ignore C and F. Not sure about this (should be simpler ways)
http://nsclient.org/nscp/wiki/CheckDisk ... ignoresome