Page 1 of 2
[SOLVED] check_wmi_plus checkdrivesize + commands
Posted: Tue Apr 21, 2015 2:28 am
by litsupport.box
Hello,
I am trying to monitor my server's free disc space, i'm using the following command to do so:
Input:
Code: Select all
NagiosXI command: $USER1$/check_wmi_plus.pl -H $HOSTADDRESS$ -u $ARG1$ -p $ARG2$ -m $ARG3$ -c $ARG4$ -t 600
Actual Format: # usr/local/nagios/libexec/check_wmi_plus.pl -H SERVER -u 'username' -p 'password' -m checkdrivesize -a 'C': -w '_FreeGB=1.6' -c '_FreeGB=2'
Output:
Code: Select all
[root@ libexec]# ./check_wmi_plus.pl -H SERVER -u 'username' -p 'password' -m checkdrivesize -a 'C': -w '_FreeGB=1.6' -c '_FreeGB=2'
CRITICAL - [Triggered by _FreeGB>2] - C: Total=39.66GB, Used=12.97GB (32.7%), Free=26.69GB (67.3%) |'C: Space'=12.97GB; 'C: Utilisation'=32.7%;
It clearly has more than 2GB free.
I looked into this a little further and it seems that people use this command to not see Free space but Used space. I don't want this because the size of my servers discs is all different from eachother.
Is there a way to still check what i want? I only want to check on free space.
Kind regards,
Farid
Re: check_wmi_plus checkdrivesize buggy
Posted: Tue Apr 21, 2015 9:39 am
by lmiltchev
You can try:
/usr/local/nagios/libexec/check_wmi_plus.pl -H SERVER -u 'username' -p 'password' -m checkdrivesize -a 'C:' -w '_FreeGB=1.6:' -c '_FreeGB=2:'
From the plugin's usage:
EXAMPLE RANGES
This table lists example WARN/CRIT criteria and when they will trigger an alert.
10 < 0 or > 10, (outside the range of {0 .. 10})
10: < 10, (outside {10 .. infinity})
~:10 > 10, (outside the range of {-infinity .. 10})
10:20 < 10 or > 20, (outside the range of {10 .. 20})
@10:20 = 10 and = 20, (inside the range of {10 .. 20})
10 < 0 or > 10, (outside the range of {0 .. 10})
10G < 0 or > 10G, (outside the range of {0 .. 10G})
Let me know if this helped.
Re: check_wmi_plus checkdrivesize buggy
Posted: Tue Apr 21, 2015 11:13 am
by rseiwert
lmiltchev is correct. You are going critical when > 2GB free. Hopefully you do have more that 2GB free. You could use :2GB to alert when less than 2GB is free.
Recommendation: There are several values you can alert off of: _Used% _UsedGB _Free% _FreeGB. The default is _Used%. The way I use check_wmi_plus is to assign the checks to the hostgroup "Windows Servers" and the assign my windows servers to this host group. Since the drive sizes can vary from 40GB to 1TB I use the _Used% warning on 85 and crit on 92. This way the same check works for all systems. Also if you use a period (.) for arg1 (-a) instead of 'C' you will get all drives in the system in one check. Since all my check_wmi_plus checks are in the hostgroup "Windows Servers" setting up a new server requires adding the host and setting the hostgroup and immediately almost twenty wmi checks are setup with zero effort.
Re: check_wmi_plus checkdrivesize buggy
Posted: Tue Apr 21, 2015 1:49 pm
by lmiltchev
Thanks for confirming this, rseiwert!
@litsupport.box
Have you tried modifying your check?
Re: check_wmi_plus checkdrivesize buggy
Posted: Wed Apr 22, 2015 2:09 am
by litsupport.box
Thank you for your reply's, this seems to work exactly as i want.

thx for the advise rseiwert i will look into that.
Re: check_wmi_plus checkdrivesize buggy
Posted: Wed Apr 22, 2015 4:45 am
by litsupport.box
I do get this:
Argument "-" isn't numeric in numeric gt (>) at /usr/local/nagios/libexec/check_wmi_plus.pl line 5914. < What does this mean?
Line 5914 = : if ($test_value > $boundary_value) {
Re: check_wmi_plus checkdrivesize buggy
Posted: Wed Apr 22, 2015 7:01 am
by litsupport.box
Since i changed this i got these "Service Check Timed Out On Worker:Worker.." :/
Re: check_wmi_plus checkdrivesize buggy
Posted: Wed Apr 22, 2015 7:07 am
by rseiwert
More info will be required such as the actual Check command and its arguments. I would guess u have an invalid argument.
Re: check_wmi_plus checkdrivesize buggy
Posted: Wed Apr 22, 2015 7:27 am
by litsupport.box
I think i found it but im not really sure:
This is what i had:
Command: i used -w $ARG4$ in the command and in the field of the Argument i used -w/c again followed by '_FreeGB=3:'
My solution was to create a command without -w/c, only $ARG4$ and then in the field of the argument i have the following:
Before: what didn't work
After: what works

Re: check_wmi_plus checkdrivesize buggy
Posted: Wed Apr 22, 2015 7:34 am
by litsupport.box
Another question on this: can i use -u $USER13$ -p $USER14$ in the commandline? instead of -u $ARG1$ -p $ARG2$?