Windows check to check space on all disks

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
jkinning
Posts: 747
Joined: Wed Oct 09, 2013 2:54 pm

Windows check to check space on all disks

Post by jkinning »

I am running Nagios XI 2014R2.6 and using the NSClient++ agent 0.4.3.131 and was trying to figure out if there is a way to check all the local drives on Windows 2008 and 2012 servers using this agent? I am currently specifying the drive letter using the check_xi_service_nsclient $USER1$/check_nt -H $HOSTADDRESS$ -s "$ARG1$" -p 12489 -v $ARG2$ $ARG3$ $ARG4$ and then ARG2$ = USEDDISKSPACE and ARG3$ = -l C -w 80 -c 95

Some of these servers have several different drive letters like C, D, F, K and others C, D, L, M, so if it was possible to have just one check to check any drive letter and the space to send out notification when X% is remaining.

Or will I have to figure out what drive letters and continue down the path I am using above?
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Windows check to check space on all disks

Post by jdalrymple »

Remove the -l bit from your $ARG2$
Add "CheckAll" to the end of your $ARG2$
You may want to add "FilterType=fixed" otherwise you'll get CD Drives, USB drives, etc.

Let us know if that does the trick.
jkinning
Posts: 747
Joined: Wed Oct 09, 2013 2:54 pm

Re: Windows check to check space on all disks

Post by jkinning »

I am doing something wrong but not sure what.

My original command with ARG2$ = USEDDISKSPACE and ARG3$ = -l C -w 80 -c 95
/usr/local/nagios/libexec/check_nt -H cinfs08p -s "" -p 12489 -v USEDDISKSPACE -l D -w 80 -c 95

Suggested command with ARG2$ = USEDDISKSPACE "CheckAll" "FilterType=fixed" and ARG3$ -w 80 -c 95
COMMAND: /usr/local/nagios/libexec/check_nt -H cinfs08p -s "" -p 12489 -v USEDDISKSPACE "CheckAll" "FilterType=fixed" -w 80 -c 95
OUTPUT: missing -l parameters
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Windows check to check space on all disks

Post by jdalrymple »

Sorry, that's my bad. I didn't see you were using check_nt.

Did you enable NRPE when you installed nsclient?

Something like this if you did:

Code: Select all

check_nrpe -H <IP> -c CheckDriveSize -a 'FilterType=FIXED CheckAll MinWarn=20% MinCrit=5%'
jkinning
Posts: 747
Joined: Wed Oct 09, 2013 2:54 pm

Re: Windows check to check space on all disks

Post by jkinning »

I thought I did but when I run that command I am getting CHECK_NRPE: Error - Could not complete SSL handshake. So I am guessing that means I didn't. :) What do I need to add to the configuration file to enable that?
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Windows check to check space on all disks

Post by ssax »

Are you able to run any other check_nrpe commands against it? Usually that error is from not specifying the allowed hosts in your nsclient.ini.
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Windows check to check space on all disks

Post by jdalrymple »

Here are the important bits: (assuming nsclient.ini, let me know if you're using an old version)

Code: Select all

[/settings/default]
allowed hosts = NETADDR/NETMASK

[/modules]
CheckDisk = 1
NRPEServer = 1

[/settings/NRPE/server]
use ssl = 1
payload length = 1024
allow nasty characters = false
allowed ciphers = ADH
ssl = true
allow arguments = 1
insecure = true
I suppose it's also worth sharing - this is the command run and ouput from my Win7 workstation:

Code: Select all

[jdalrymple@localhost libexec]$ ./check_nrpe -H winhost -c checkdrivesize -a CheckAll MinWarn=20% MinCrit=5% FilterType=fixed
WARNING C:\: Total: 107.47GB - Used: 87.653GB (82%) - Free: 19.817GB (18%)|'C:\ free'=19.81665GB;21.49394;5.37348;0;107.46972 'C:\ free %'=18%;19;4;0;100 'D:\ free'=868.66137GB;186.30214;46.57553;0;931.51073 'D:\ free %'=93%;19;4;0;100 '\\?\Volume{80ee73c6-a6c0-11e4-bd5c-806e6f6e6963}\ free'=3.628GB;2.34648;0.58662;0;11.73241 '\\?\Volume{80ee73c6-a6c0-11e4-bd5c-806e6f6e6963}\ free %'=30%;19;4;0;100
-- edit --

Adding a bit more info
jkinning
Posts: 747
Joined: Wed Oct 09, 2013 2:54 pm

Re: Windows check to check space on all disks

Post by jkinning »

That appears to work.

So within the Nagios XI client GUI interface how would I create this check? What would I need to place on ARG1$,ARG2$, etc?
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Windows check to check space on all disks

Post by jdalrymple »

See my 2 attachments

I prefer to wrap everything into just $ARG1$ - the exact contents of my $ARG1$:

Code: Select all

checkdrivesize -a CheckAll MinWarn=20% MinCrit=5% FilterType=fixed
You do not have the required permissions to view the files attached to this post.
jkinning
Posts: 747
Joined: Wed Oct 09, 2013 2:54 pm

Re: Windows check to check space on all disks

Post by jkinning »

Well, not sure what happened but I added the
[/settings/NRPE/server]
use ssl = 1
payload length = 1024
allow nasty characters = false
allowed ciphers = ADH
ssl = true
allow arguments = 1
insecure = true

to my nsclient configuration file on the Windows server which I am running 0.4.3.77 version of the nsclient++ and getting CHECK_NRPE: Error - Could not complete SSL handshake.
Locked