skip to navigation
skip to content

alignak_checks_wmi 1.0.0

Alignak checks pack for Windows Management Instrumentation

Alignak checks package for Windows WMI

*Checks pack for monitoring hosts with Windows Management Instrumentation (WMI)*

.. image::
:alt: Most recent PyPi version

.. image::
:alt: Join the chat #alignak on

.. image::
:alt: License AGPL v3


The installation of this checks pack will copy some configuration files in the Alignak default configuration directory (eg. */usr/local/etc/alignak*). The copied files are located in the default sub-directory used for the packs (eg. *arbiter/packs*).

From PyPI
To install the package from PyPI:

sudo pip install alignak-checks-wmi

From source files
To install the package from the source files:

git clone
cd alignak-checks-wmi
sudo pip install .

**Note:** *using `sudo python install` will not correctly manage the package configuration files! The recommended way is really to use `pip`;)*



**Note**: this pack embeds the ``wmic`` binary that is not always easy to find for Linux distributions :/

The embedded version of ``wmic`` is only compatible with Linux distros. For Unix (FreeBSD), you can simply install the wmic port:

pkg install wmi-client
cd /var/cache/pkg/
tar Jxvf wmi-client-1.3.16_1.txz
# winexe and wmic scripts are available in /usr/local/bin/

The ** script assumes that the executable *wmic* is installed in the Alignak plugins directory.
Edit the *check_wmi_plus.conf* configuration file to change the *wmic* location if necessary. The variable to set is **$wmic_command**.

**Note:** The files ** and *check_wmi_plus.conf*, located in the */usr/local/var/libexec/alignak*, need some configuration. Edit them and search for the ALIGNAK keyword to find out what is to be configured and set according to your server.

Edit the */usr/local/etc/alignak/arbiter/packs/resource.d/wmi.cfg* file and configure the domain name, user name and password allowed to access remotely to the monitored hosts WMI.

#-- Active Directory for WMI
# Replace MYDOMAIN with your domain name or . for local user account
# Replace MYUSER with the WMI authorized user (domain or local user account)
# Replace MYPASSWORD with the WMI authorized user password

Install PERL dependencies for check_wmi_plus plugin
You must install some PERL dependencies for the ** script.

On some Linux distros, you can::

su -
apt-get install libnumber-format-perl
apt-get install libconfig-inifiles-perl
apt-get install libdatetime-perl

Or you can use the PERL *cpan* utility::

cpan install Config::IniFiles
cpan install Number::Format
cpan install DateTime

More information is available on `Check WMI Plus Web site<http:"" checkwmiplus="" ?q="Installation">`_.

Prepare Windows host
Some operations are necessary on the Windows monitored hosts if WMI remote access is not yet activated.

Create a user account:

- username/password (example): alignak/alignak
- member of following groups: Administrators, Remote DCOM users
- Deactivate interactive login permissions (more secure)

Check that WMI and RPC services are started

The Windows Firewall must allow inbound trafic for:
- Windows Firewall Remote Management (RPC)
- Windows Management Instrumentation (DCOM-In)
- Windows Management Instrumentation (WMI-In)

This page contains more information about remote WMI configuration:

Test remote WMI access with the plugins files:

# Basic wmic command ...
$ /usr/local/var/libexec/alignak/wmic -U .\\alignak%alignak // 'Select Caption From Win32_OperatingSystem'

# Alignak plugin command ...
$ /usr/local/var/libexe/alignak/ -H -u ".\\alignak" -p "alignak" -m checkdrivesize -a '.' -w 90 -c 95 -o 0 -3 1 --inidir=/usr/local/var/libexec/alignak

**Note**: these commands assume that you created an *alignak* user account with *alignak* as a password.

As a default, WMI opens random TCP ports to communicate with the requesting customer. The Windows WMI service can be configured to use only one port as explained here:

An abstract of this article::

To set up a fixed port for WMI
1. Stop the WMI service by typing the command: net stop "Windows Management Instrumentation", or net stop winmgmt
2. At the command prompt, type: winmgmt -standalonehost
3. Restart the WMI service again in a new service host by typing: net start "Windows Management Instrumentation" or net start winmgmt
4. Establish a new port number for the WMI service by typing: netsh firewall add portopening TCP 24158 WMIFixedPort

To undo any changes you make to WMI, type: winmgmt /sharedhost, then stop and start the winmgmt service again.

Alignak configuration

You simply have to tag the concerned hosts with the template `windows-wmi`.

define host{
use windows-wmi
host_name host_windows_wmi

The main `windows-wmi` template declares macros used to configure the launched checks. The default values of these macros listed hereunder can be overriden in each host configuration.



#Default Network Interface

# Now some alert level for a windows host

To set a specific value for an host, declare the same macro in the host definition file.

define host{
use windows-wmi
contact_groups admins
host_name sim-vm

# Specific values for this host
# Change warning and critical alerts level for memory
# Same for CPU, ALL_CPU, DISK, LOAD, NET, ...

# Exclude some services from automatic start check
# Use a regexp that matches against the short or long service name as it can be seen in the properties of the service in Windows.
# The matching services are excluded in the resulting list.
# Example: (ShortName)|(ShortName)| ... |(ShortName)
_WINDOWS_EXCLUDED_AUTO_SERVICES (IAStorDataMgrSvc)|(MMCSS)|(ShellHWDetection)|(sppsvc)|(clr_optimization_v4.0.30319_32)

Bugs, issues and contributing

Contributions to this project are welcome and encouraged ... `issues in the project repository <https:"" alignak-monitoring-contrib="" alignak-checks-wmi="" issues="">`_ are the common way to raise an information.  
File Type Py Version Uploaded on Size
alignak_checks_wmi-1.0.0.tar.gz (md5) Source 2017-09-12 3MB