[SOLVED] check_wmi_plus checkdrivesize + commands

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
litsupport.box
Posts: 80
Joined: Wed Apr 02, 2014 7:24 am

[SOLVED] check_wmi_plus checkdrivesize + commands

Post 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
Last edited by litsupport.box on Thu Apr 23, 2015 4:26 am, edited 1 time in total.
Nagios XI Version : 2014R2.6
fqdn 2.6.32-431.17.1.el6.x86_64 x86_64
CentOS release 6.5 (Final)
Gnome is not installed
Proxy appears to be in use
VMware Image
Mod Gearman
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: check_wmi_plus checkdrivesize buggy

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
rseiwert
Posts: 196
Joined: Wed Jun 22, 2011 10:33 pm
Location: Somewhere between Here and Now

Re: check_wmi_plus checkdrivesize buggy

Post 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.
Grumpy Olde IT Guy
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: check_wmi_plus checkdrivesize buggy

Post by lmiltchev »

Thanks for confirming this, rseiwert!

@litsupport.box
Have you tried modifying your check?
Be sure to check out our Knowledgebase for helpful articles and solutions!
litsupport.box
Posts: 80
Joined: Wed Apr 02, 2014 7:24 am

Re: check_wmi_plus checkdrivesize buggy

Post by litsupport.box »

Thank you for your reply's, this seems to work exactly as i want. :D thx for the advise rseiwert i will look into that.
Last edited by litsupport.box on Wed Apr 22, 2015 4:46 am, edited 1 time in total.
Nagios XI Version : 2014R2.6
fqdn 2.6.32-431.17.1.el6.x86_64 x86_64
CentOS release 6.5 (Final)
Gnome is not installed
Proxy appears to be in use
VMware Image
Mod Gearman
litsupport.box
Posts: 80
Joined: Wed Apr 02, 2014 7:24 am

Re: check_wmi_plus checkdrivesize buggy

Post 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) {
Nagios XI Version : 2014R2.6
fqdn 2.6.32-431.17.1.el6.x86_64 x86_64
CentOS release 6.5 (Final)
Gnome is not installed
Proxy appears to be in use
VMware Image
Mod Gearman
litsupport.box
Posts: 80
Joined: Wed Apr 02, 2014 7:24 am

Re: check_wmi_plus checkdrivesize buggy

Post by litsupport.box »

Since i changed this i got these "Service Check Timed Out On Worker:Worker.." :/
Nagios XI Version : 2014R2.6
fqdn 2.6.32-431.17.1.el6.x86_64 x86_64
CentOS release 6.5 (Final)
Gnome is not installed
Proxy appears to be in use
VMware Image
Mod Gearman
User avatar
rseiwert
Posts: 196
Joined: Wed Jun 22, 2011 10:33 pm
Location: Somewhere between Here and Now

Re: check_wmi_plus checkdrivesize buggy

Post by rseiwert »

More info will be required such as the actual Check command and its arguments. I would guess u have an invalid argument.
Grumpy Olde IT Guy
litsupport.box
Posts: 80
Joined: Wed Apr 02, 2014 7:24 am

Re: check_wmi_plus checkdrivesize buggy

Post 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
Image

After: what works
Image
Nagios XI Version : 2014R2.6
fqdn 2.6.32-431.17.1.el6.x86_64 x86_64
CentOS release 6.5 (Final)
Gnome is not installed
Proxy appears to be in use
VMware Image
Mod Gearman
litsupport.box
Posts: 80
Joined: Wed Apr 02, 2014 7:24 am

Re: check_wmi_plus checkdrivesize buggy

Post by litsupport.box »

Another question on this: can i use -u $USER13$ -p $USER14$ in the commandline? instead of -u $ARG1$ -p $ARG2$?
Nagios XI Version : 2014R2.6
fqdn 2.6.32-431.17.1.el6.x86_64 x86_64
CentOS release 6.5 (Final)
Gnome is not installed
Proxy appears to be in use
VMware Image
Mod Gearman
Locked