check_drivesize on terminalserver

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
KWE1980
Posts: 4
Joined: Wed May 23, 2018 4:56 am

check_drivesize on terminalserver

Post by KWE1980 »

Hello,
we are using Nagios 4.3.4 and checking our Windows Server with check_nrpe and NSClient version NSCP-0.5.2.35-x64.
The command we use is this one:

Code: Select all

Check_Drivesize "crit=free<1G" "warn=free<10G" drive=all-volumes "filter=type in ('fixed', 'remote')" show-all
an the result for example:
OK C:\: 124.249GB/249.997GB used,
C:\Users\user1\: 169.84MB/19.998GB used
C:\Users\user2\: 393.277MB/19.998GB used
C:\Users\user3\: 298.773MB/19.998GB used
...
We want have only the "c:\" partition, not the "C:\Users\" "drives". We searched in this forums and others sites and found some hints. We tried to use "exclude=c:\users\*", "exclude=c:\u*", "exclude=c:\users\", "exclude=c:\users\*" and some variants for "filter", but without any success.

Does someone know, how to exclude these volumes?

Many thanks in advance.
Kai
Last edited by KWE1980 on Thu May 24, 2018 5:39 am, edited 1 time in total.
kyang

Re: check_drivesize on terminalserver

Post by kyang »

Hello,

You would want to specify it like this --> "drive=c:"
https://docs.nsclient.org/reference/win ... _drivesize

Here's an example command & output.

Code: Select all

[root@localhost libexec]# ./check_nrpe -H 192.168.3.242 -c check_drivesize -a "warn=free<95%" "crit=free<90%" "drive=c:"

CRITICAL c:: 326.317GB/820.022GB used|'c: free'=493.70514GB;779.02135;738.02023;0;820.02248 'c: free %'=60%;95;90;0;100
KWE1980
Posts: 4
Joined: Wed May 23, 2018 4:56 am

Re: check_drivesize on terminalserver

Post by KWE1980 »

Hello,

thanks for you response.
This is no solution for us. We need dynamic driveletters, for example we want have
  • system A: it has drives c +e
    system B: it has drives c + d +f
    system C: it has drives c
To configure the drive letters hard in the check is not what we want.
But i think i got the solution. I red again the documentation and found this:

Code: Select all

drive=all-drives
instead of

Code: Select all

drive=all-volumes
The response is:

Code: Select all

OK C:\: 124.338GB/249.997GB used
the hole Command for check_NRPE:

Code: Select all

Check_Drivesize "crit=free<1G" "warn=free<10G" drive=all-drives "filter=type in ('fixed', 'remote')" show-all
EDIT:
in the config i adjusted it to this:
Service:

Code: Select all

define service{
	use			normal-service
	hostgroup_name		windows-servers
	service_description	Drive Space all drives
	check_command		check_nrpe_v2_arg3!8192!5666!Check_Drivesize -a 'crit=free lt 1G' 'warn=free lt 10G' 'drive=all-drives' 'filter=type in ('fixed', 'remote')' 'show-all'
	}
Command:

Code: Select all

define command{
	command_name	check_nrpe_v2_arg3
	command_line	$USER1$/check_nrpe -2 -P $ARG1$ -H $HOSTADDRESS$ -p $ARG2$ -c $ARG3$ # >> /usr/local/nagios/var/service-perfdata.out
	}
Please close this thread.
Last edited by KWE1980 on Fri May 25, 2018 2:35 am, edited 1 time in total.
kyang

Re: check_drivesize on terminalserver

Post by kyang »

Ah okay!

Glad you found the solution.

Yes, that is what I would use.

Are we okay to close this thread?
KWE1980
Posts: 4
Joined: Wed May 23, 2018 4:56 am

Re: check_drivesize on terminalserver

Post by KWE1980 »

i am sorry, the problem is not solved.
We still have the problem, sometimes the system revert "Filter processing failed: Failed to get size for \?\Volume{8b925a08-5d1b-11e7-a216-806e6f6e6963}\: 57: Falscher Parameter."
At the moment i see only one way to solve it: register every system with its drives in configuration. But i want to just give a dynamic value like "all-drives/all-volumes/...", because that is much less effort to maintain in configuration files and the file is clearer to read.

So any other suggestion is welcome.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_drivesize on terminalserver

Post by scottwilkerson »

Here is a NSClient thread about the same issue
https://github.com/mickem/nscp/issues/276

you might be able to add the filter

Code: Select all

"filter=removable = 1"
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
KWE1980
Posts: 4
Joined: Wed May 23, 2018 4:56 am

Re: check_drivesize on terminalserver

Post by KWE1980 »

Hello,
the right parameter was

Code: Select all

exclude='System reserved' 
, since then the "Failure 57 " doesn't appeared.
Many thanks.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_drivesize on terminalserver

Post by scottwilkerson »

KWE1980 wrote:Hello,
the right parameter was

Code: Select all

exclude='System reserved' 
, since then the "Failure 57 " doesn't appeared.
Many thanks.
Glad it is resolved.

Locking
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked