This quick-start guide will provide very high level instructions on how to get Check WMI Plus up and running on your Nagios system.
It assumes that you will be able to "fill in" a lot of the missing information by either reading the other pages on this site or with your general IT knowledge.
There is some more detail in the installation page.
There is a comprehensive installation example here.
Preparing the Monitored Windows System(s)
On the Windows system(s)/Domain that will be monitored:
- Create a user that will be used for Check WMI Plus
- Remove login rights. Add Domain Admin privileges. Here is some documentation around about how to reduce the privilege required
Get Zenoss wmic working.
Either from source:
- Download the source
- Compile it and either make install or just find and copy wmic to a location on your Nagios server.
or from an RPM:
- Find an RPM from rpm.pbone.net.
- If you are lucky, you probably don't need to install the RPM (depending on how it was built), and you may just be able to extract wmic and copy it to a location on your Nagios server.
/bin/wmic -U USER%PASS //HOST 'Select Caption From Win32_OperatingSystem'
Expected Output should be similar to:
Microsoft Windows XP Professional|Microsoft Windows XP Professional|C:\WINDOWS|\Device\Harddisk0\Partition1
Installing the Plugin
Download the latest version of the plugin.
Untar it to the directory of your choice.
Version 1.46 and earlier
Find all the lines with "# CHANGE THIS IF NEEDED" and ensure that those settings meet your requirements.
Version 1.47 and later
Rename check_wmi_plus.conf.sample to check_wmi_plus.conf
Edit check_wmi_plus.pl and set $conf_file to the location of your copy of check_wmi_plus.conf
Edit check_wmi_plus.conf and set all the directory locations.
Now make sure you have the required perl modules installed (listed here). The easiest way to do this is just to run the plugin. If you get an error like "Can't locate SOMENAME.pm" then you are missing a required perl module.
Testing the Plugin
Run some basic command-line checks:
(Note some checks will need to be run twice to get meaningful output since they require 2 WMI queries).
Run this twice:
check_wmi_plus.pl -H HOST -m checkcpu -u USER -p PASS
OK (Sample Period 26 sec) - Average CPU Utilisation 15.19%|'Avg CPU Utilisation'=15.19%;
check_wmi_plus.pl -H HOST -m sample -s minimal -u USER -p PASS
OK - Caption=Microsoft Windows XP Professional, Service Pack 3
check_wmi_plus.pl -H HOST -m checkdrivesize -u USER -p PASS -a c: -o 1
Output: OK - C: Total=19.99GB, Used=11.66GB (58.3%), Free=8.33GB (41.7%) |'C: Space'=11.66GB; 'C: Utilisation'=58.3%;
check_wmi_plus.pl -H HOST -m checkservice -u USER -p PASS -a auto
Output: OK - Found 36 Services(s), 36 OK and 0 with problems. |'Total Service Count'=36; 'Service Count OK State'=36; 'Service Count Problem State'=0;
Try an ini file check:
Run this twice:
check_wmi_plus.pl -H HOST -m checkeachcpu -u USER -p PASS
OK (Sample Period 21 sec) - CPU0=43.8% CPU_Total=43.8% |'Avg Utilisation CPU0'=43.8%; 'Avg Utilisation CPU_Total'=43.8%;
Setting Up Nagios for Check WMI Plus
Add these Nagios Command Definitions.
Add these Nagios Service Definitions (make sure you modify them to suit you!)
Use some Nagios Host/Hostgroup Definitions (make sure you modify them to suit you!)
Customise Your Checks
Read the "WARNING AND CRITICAL SPECIFICATION" section of the check_wmi_plus.pl --help output so that you can add your own warning/critical criteria.
Read about all the checks that can be made.
Create your own checks by copying various sections from the .ini files into your own mycustom.ini file.
Share your checks with others