Quick Start

NOTE: For the legacy information refer to Quick Start (Legacy)

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.

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

Prerequisites

Check WMI Plus requires the WMIC Server which is part of the aiowmi project. To install that simply change into the directory where you want it installed and git clone https://github.com/cesbit/aiowmi. The github page for WMIC Server contains information on how to install that. In summary, you create a long running API server that accepts WMI queries from Check WMI Plus. WMIC Server forwards the WMI queries to the target Windows host.

Test the WMIC Server following the sample usage instructions

Installing the Plugin
Download the latest version of the plugin.

Version 1.60 and later
Untar the download bundle to a temporary directory before moving the files to their final locations.
The download bundle contains all the executable files at the top level of the bundle. You will want to copy these files to a folder such as /usr/local/bin.
An etc folder is also contained in the bundle. This etc folder should be copied to /etc as this is now the default location for the config file and ini files.
Rename check_wmi_plus.conf.sample to check_wmi_plus.conf
Edit check_wmi_plus.conf and set all the directory locations.
Make sure the config files are all readable and writable by the Nagios user
Remove the temporary folder

All versions
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
Expected Output: OK (Sample Period 26 sec) - Average CPU Utilisation 15.19%|'Avg CPU Utilisation'=15.19%;

Run this: check_wmi_plus.pl -H HOST -m sample -s minimal -u USER -p PASS
Expected Output: OK - Caption=Microsoft Windows XP Professional, Service Pack 3

Run this: check_wmi_plus.pl -H HOST -m checkdrivesize -u USER -p PASS -a c: -o 1
Expected Output: OK - C: Total=19.99GB, Used=11.66GB (58.3%), Free=8.33GB (41.7%) |'C: Space'=11.66GB; 'C: Utilisation'=58.3%;

Run this: check_wmi_plus.pl -H HOST -m checkservice -u USER -p PASS -a auto
Expected 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
Expected Output: 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!)
Reload Nagios.

Customise Your Checks
Run: check_wmi_plus.pl --help
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.

Run: check_wmi_plus.pl --help
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.