Quick Start (Legacy)

NOTE: This is the legacy page which refers to the legacy wmic command line binary. For information using the new wmic_server, refer to Quick Start

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 are comprehensive installation examples 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

Prerequisites
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.

Test wmic.
Command Line: /bin/wmic -U USER%PASS //HOST 'Select Caption From Win32_OperatingSystem'
Expected Output should be similar to:
CLASS: Win32_OperatingSystem
Caption|Name
Microsoft Windows XP Professional|Microsoft Windows XP Professional|C:WINDOWS|DeviceHarddisk0Partition1

Installing the Plugin
Download the latest version of the plugin.

Version 1.46 and earlier
Untar it to the directory of your choice.
Edit check_wmi_plus.pl
Find all the lines with “# CHANGE THIS IF NEEDED” and ensure that those settings meet your requirements.

Version 1.47 and later
Untar it to the directory of your choice.
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.

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.