Check Windows Clients with Nagios and WMI

Notes

With WMI you can read and write windows settings from local or remote location. WMI is enabled by default on all microsoft computer systems, you need only to allow the remote access on it. This is very interesting for nagios, we can configure nagios to check services on remote windows hosts without installing any agent like nrpe or nsclient++. This documentation is written for Debian Wheezy with a running nagios3 configuration.

Installation

Check WMI Plus is for the WMI remote check implement on linux, Download it from here: CheckWMIPlus

First install requirements

Create directory for the check wmi plus installation, I use /opt/check_wmi_plus

Download the latest check wmi plus build from the link above and extract it:

Edit the $conf_file path in the check_wmi_plus.pl script:





Go into the etc directory and move all files from the subdirectory:

Edit the $base_dir option in the check_wmi_plus.conf configuration file:

In the same directory create the authentication file (we need this file later for the nagios service check configuration):

The windows account above must be authorized to read WMI values from the windows clients. Don’t forget to remove the read access for anyone:

The WMI check script is now ready for the nagios service checks implementation.

Configuration

This service check example describes a disk free space check for drive letter C:, the check will run at 11:00 AM one time a day from Monday to Friday. I have put all in one file.

Reload nagios configuration

Now you should see the service group in the nagios webinterface

Nagios WMI Services

This is only an example for disk free size check, read the WMI references for more information about other classes and objects.