Querying WMI

Besides built-in support for performance counters, the Zabbix agent also supports WMI queries.

Note

Zabbix supports WMI through the Zabbix agent—remote WMI is not supported at this time.

To extract some useful information, we need a WMI query, and we might want to test the queries quickly—that can be done in Windows or by using the Zabbix agent. On the Windows side, the wbemtest.exe utility can be used. When launching it, click on Connect, accept the default namespace of rootcimv2, and click on Connect again. Then, in a dialog like this, click on Query:

Querying WMI

You can enter complete queries here. For example, we could ask for the current time zone with a query:

SELECT StandardName FROM Win32_TimeZone
Querying WMI

An alternative way to test such queries through the Zabbix agent would be with the zabbix_get utility, discussed in Chapter 3, Monitoring with Zabbix Agents and Basic Protocols.

With the query available, we can proceed with creating an item. Navigate to Configuration | Hosts, click on Items next to Windows host, and click on Create item. Fill in the following:

  • Name: Time zone
  • Key: wmi.get[rootcimv2,SELECT StandardName FROM Win32_TimeZone]
  • Type of information: Character
  • Update interval: 300

The key here was wmi.get, the first parameter was namespace, and the second parameter was the query itself. We don't expect the time zone to change that often, so we increased the update interval a bit—normally one would use an even larger interval, but we will want the first value to come in soon enough. When done, click on the Add button at the bottom. Check Monitoring | Latest data—in some five minutes the value should be there:

Querying WMI

This way one can monitor any output from the WMI queries—but note that a single value should be returned; multiple values are not supported. If multiple values are returned, only the first value will be processed.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.176.225