Page 1 of 2
check drive free space instead of percentage of free space
Posted: Fri Apr 05, 2013 3:39 am
by Frédéric GRANAT
Hi,
I use the following command in my service template to check percentage of free space :
$USER1$/check_wmi_plus.pl -H $HOSTADDRESS$ -u $ARG1$ -p $ARG2$ -m checkdrivesize -a "$ARG3$" -w $ARG4$ -c $ARG5$ $ARG6$
where
ARG3 = several disks (C|D|Q,...etc)
ARG4 = percentage of free space warning
ARG5 = percentage of free space critical
Now, I don't want to check the percentage but the value of free space remaining (5 Gb by example)
ARG4=5G
ARG5=3G
How can I do ?
Rgds,
Frederic
Re: check drive free space instead of percentage of free spa
Posted: Fri Apr 05, 2013 9:20 am
by slansing
Have a look at this snippit from the plugin's internal help flag:
for MODE=checkdrivesize:
-w _UsedGB=10G -w 15 -w _Free%=5: -c _UsedGB=20G -c _Used%=25
This will generate a warning if
- the Used GB on the drive is more than 10G or
- the used % of the drive is more than 15% or
- the free % of the drive is less than 5%
This will generate a critical if
- the Used GB on the drive is more than 20G or
- the used % of the drive is more than 25%
That should help get the ball rolling, it looks like you need to designate a "_FreeGB" value:
Valid Warning/Critical Fields are: _Used% (Default), _UsedGB, _Free%, _FreeGB.
Re: check drive free space instead of percentage of free spa
Posted: Mon Apr 08, 2013 4:52 am
by Frédéric GRANAT
Hi,
that doesn't work
Here's my command
Code: Select all
$USER1$/check_wmi_plus.pl -H $HOSTADDRESS$ -u $ARG1$ -p $ARG2$ -m checkdrivesize -a "$ARG3$" -w _FreeGB=$ARG4$ -c _FreeGB=$ARG5$ $ARG6$
Here's my template (using above command)
Code: Select all
Command view
$USER1$/check_wmi_plus.pl -H $HOSTADDRESS$ -u $ARG1$ -p $ARG2$ -m checkdrivesize -a "$ARG3$" -w _FreeGB=$ARG4$ -c _FreeGB=$ARG5$ $ARG6$
ARG3=C|D|E|Q|H|I|L|M|N
ARG4=5G
ARG5=4G
Re: check drive free space instead of percentage of free spa
Posted: Mon Apr 08, 2013 9:37 am
by sreinhardt
What about it is not working? To be clear, this check does not check if there is 5GB free, it only checks how much you presently have used. So if you have a 250gb drive, and you have want to see when you only have 5GB left, you need to set warning to -w 245gb, not -w 5gb.
Re: check drive free space instead of percentage of free spa
Posted: Mon Apr 08, 2013 9:59 am
by Frédéric GRANAT
I'm very astonished since someone of the support tells me that there was a way to check free space.
If, according to you, there's is no way to chek free space, then what is the use of _FreeGB and _Free%.
I will await the answer of slansing.
Rgds,
Frederic
Re: check drive free space instead of percentage of free spa
Posted: Mon Apr 08, 2013 12:25 pm
by lmiltchev
I believe the plugin's logic is "wrong" with the "_FreeGB" argument. It should give you a "Warning" or "Critical" if LESS than the thresholds specified. But the plugin does the opposite.
For example, when I have less than 20 GB free space, I would like to get a warning, but if I have less than 10 GB - I would like to get a critical. So, I try:
Code: Select all
/usr/local/nagios/libexec/check_wmi_plus.pl -H <myhost> -u '<username>' -p '<password>' -m checkdrivesize -a 'C': -w '_FreeGB=20' -c '_FreeGB=10'
however, the output is:
Code: Select all
CRITICAL - [Triggered by _FreeGB>10] - C: Total=452.96GB, Used=197.61GB (43.6%), Free=255.35GB (56.4%) |'C: Space'=197.61GB; 'C: Utilisation'=43.6%;
I get a "CRITICAL", because my free space (255.35 GB) is MORE than my threshold of 10GB... which is not what I am after.
If I try:
Code: Select all
/usr/local/nagios/libexec/check_wmi_plus.pl -H <myhost> -u '<username>' -p '<password>' -m checkdrivesize -a 'C': -w '_FreeGB=400' -c '_FreeGB=300'
then I get:
Code: Select all
OK - C: Total=452.96GB, Used=197.61GB (43.6%), Free=255.35GB (56.4%) |'C: Space'=197.61GB; 'C: Utilisation'=43.6%;
because my free space LESS than the thresholds specified.
I am not sure what is going to be the best solution, but I would probably use "_UsedGB" or "_Used%" instead of "_FreeGB" and "_Free%".
Re: check drive free space instead of percentage of free spa
Posted: Tue Apr 09, 2013 1:42 am
by Frédéric GRANAT
I would probably use "_UsedGB" or "_Used%" instead of "_FreeGB" and "_Free%".
=> The problem is that the total amount of disk is different on each server. So _UsedGB will have to be different.
It seems to me that it's normal to check free space, and it's not possible on Nagios.
What solution do you propose to check free space (in GB)?
Frederic
Re: check drive free space instead of percentage of free spa
Posted: Tue Apr 09, 2013 11:49 am
by slansing
It is most definitely possible to check free space.. this is a issue with the way the plugin you are choosing to use is formatted.. you may want to look into check_nrpe, check_nt, NRDP, or even SNMP. There are many ways to return performance metrics from a Windows system. Have you taken a look at your system's performance counters? There are a incredible amount of options available on that front alone. Let us know if you need assistance with any of these, but if you are set on using that wmi plugin you will want to contact it's developer and ask if they can make a patch to the code for you, or you could alter it your self if the licensing allows.
Re: check drive free space instead of percentage of free spa
Posted: Wed Apr 10, 2013 2:16 am
by Frédéric GRANAT
Hi,
I saw that it was possible to check free space in Gb with check_nrpe.
But I would have to make a big change on my nagios platform (spending a lot of time on it).
I hoped that I could check it with my actual command but it seems it's not possible.
I'm going to manage by myself.
Frederic
Re: check drive free space instead of percentage of free spa
Posted: Wed Apr 10, 2013 1:05 pm
by slansing
NRPE would require you to install the NSClient++ agent on your windows system, though it is quite easy to configure. Let us know if you need assistance.