Skip to content

Repository files navigation

Cacti WMI Plugin for Windows Devices

The WMI Plugin provides data collection services for devices that support the WMI protocol. It operates asyncrhonously to the Cacti data collection and stores the resulting information into cache tables. These cache tables can then be used to generate graphs, thresholds and alerts. It collects over WMI using one of two transports, chosen automatically from the Cacti server's operating system (see Transports below).

WARNING: Development in progress

This plugin is NOT fully functional. It should not be used on production systems. Use at your own risk!

Installation

To install the plugin, simply copy the plugin_wmi directory to Cacti's plugins directory and rename it to simply 'wmi'. Once this is complete, goto Cacti's Plugin Management section, and Install and Enable the plugin. Once this is complete, you can start to define WMI queries for your Windows and other Device Templates that support WMI.

Make certain that you install the wmic binary if you are planning on running on Linux. Cacti with PHP 8.2 or newer is required.

Transports

Each query runs through a transport, chosen automatically from the Cacti server's operating system. Code that constructs Linux_WMI directly can pass an explicit transport instead.

  • wmic (default on a Linux server). Uses the Linux wmic client to reach Windows hosts over DCOM. Install the wmi-client / openwsman package and keep the binary path in Linux_WMI (/usr/bin/wmic) in step. This client predates current Windows hardening; hosts that disable NTLMv1 or enforce the DCOM packet-integrity level (KB5004442) may reject it. There is currently no console setting to switch a Linux Cacti server to the PowerShell transport for such hosts; it is only available to code that constructs Linux_WMI directly and passes an explicit transport (see below).
  • PowerShell / CIM (default on a Windows server). Uses Get-CimInstance through pwsh or powershell.exe, so it works when Cacti runs on Windows and against a remote host over WinRM/CIM. Needs PowerShell on the Cacti server and, for a remote host, WinRM enabled on the target. Credentials and every device-supplied value are passed through the child process environment and a fixed script on standard input, never on the command line.

Usage

The WMI plugin allows you to define multiple Queries, and then associate those queries with Cacti Device Templates. Therefore, if you have a generic Windows Device Template, you can add those queries that are significant for a general Windows device. If you have a Microsoft SQL Server Device Template, you can add WMI Queries that are specific to Windows SQL Server there.

There is presently only one setting support in the WMI plugin, and that is to Autocreate the actual WMI polling at device creation or update based upon the WMI Queries defined as a part of the Device Template. This setting can be found under Settings -> Device Defaults.

Credentials are added under WMI Authentication, and the WMI Query Tool under Utilities runs an ad-hoc query against a device for testing.

Access

The plugin registers a WMI Management realm covering account management, query definition, and the query tool. The Template Editor role is additionally granted the query-definition page only; credential management and the live query tool stay behind the WMI Management realm. The poller needs the host password in cleartext, so accounts are stored reversibly, the same posture Cacti core uses for SNMP v3 credentials; protect the database accordingly.

Authors

The wmi plugin has been was developed several years ago but never actually finished. This release formalizes it's behavior and provides a new level of scalability to Cacti when gathering data from WMI compatible device's.

ChangeLog

--- 1.1 ---

  • issue#1: PHP and SQL backtrace when deleting stored WMI queries or credentials

  • issue#2: Issues with passwords containing unescaped special chars

--- 1.0 ---

  • feature: Initial Support for Cacti 1.0

Copyright (c) 2004-2026 - The Cacti Group, Inc.

Releases

Packages

Used by

Contributors

Languages