WMI monitoring failures

In Unit Platform, the monitoring checks can fail if the WMI repository does not return the correct information or returns an error. This article presents some alternatives to correct this problem.

IMPORTANT: follow the instructions below at your own risk. Some procedures listed here may cause some systems to fail. If you are not sure what to do, contact Microsoft and ask for instructions.

Note: to execute the commands below, it’s necessary to have access to a command prompt (cmd.exe) with administrator privileges.

Restart the server

Sometimes the solution to the problem is a simple reboot. It’s not guaranteed, but this is the easiest alternative and it has a low risk of causing problems.

Restart the WMI service

It’s recommended to restart the server, but if this is not possible, you can try to restart only the WMI service:

net stop winmgmt /y
net start winmgmt

WMI diagnostics (WMIdiag)

To detect WMI repository inconsistencies, there is the WMIdiag tool, created by Microsoft, that analyses the system and points out any configuration errors:

Click here to download WMIdiag.

To learn how to use it, read this article.

Update the performance counters

This alternative requires the use of the command  wmiadap to force the update of the performance counters.

The parameter /f parses all the performance libraries on the system and refreshes the classes derived from Win32_PerfRawData and Win32_PerfFormattedData.

wmiadap /f

The parameter /r parses all the Windows Driver Model drivers on the system to create performance objects.

wmiadap /r

Resyncronize the performance counters

Another way to try to recover corrupted performance counters is to use the command winmgmt. For that, execute the following commands:

# When Windows version is older than 2003, execute this command to clear previous resync attempts
# In systems newer than 2003 this command won't work
winmgmt /clearadap

# resync the counters
winmgmt /resyncperf

Reload the performance counters

According to this Technet article, in the case the counters were not installed properly or with the wrong permissions, this command can be used to solve the problem:

lodctr /r

Rebuild the WMI repository

One of the last options is to restore the WMI to its original state. To rebuild the WMI repository, use the commands below (Windows Vista or newer).

IMPORTANT: if your system has third party softwares that use the WMI, this command can cause these softwares to break and require a reinstall. Use the commands below at your own risk.

net stop winmgmt /y
Winmgmt /resetrepository
net start winmgmt

To learn more about these commands, click here.

Update Windows

Check if there is an update related to WMI that hasn’t been installed. Hotfixes like this can be available for your system.

Third party counters

Some applications create their own counters. If that is the case, try reinstalling the software or contact the manufacturer to obtain instructions on how to proceed.