Monitoring

Troubleshooting WMI

Overview of WMI Access Permissions

Note:  A windows Collector must be used in order to monitor windows hosts.

The LogicMonitor Collector primarily uses WMI to monitor Windows servers (e.g. CPU, memory, disks, etc.).Most issues with the Windows task collection are the result of permission restrictions when the Collector machine attempts to query your hosts for data.

In these situations, the credentials for both of your Collector services ("LogicMonitor Collector" and "LogicMonitor Watchdog") should reference either a Domain user that is an Administrative account on the hosts to be monitored , or a local administrator that will be available on each Windows host to be monitored by this Collector. To change the user the services run as, change the credentials in the "Log On" tab for both services, and then start the services again.

If you cannot run the Collector under an administrator user, or if you are monitoring hosts between multiple domains and need to make a host-specific credential adjustment, recommended practice is to follow these instructions to add the "wmi.user" & "wmi.pass" custom properties to your host. The "wmi.user" custom property should be formatted as DOMAIN\USERNAME in these situations. To specify a local user rather than a domain user, replace DOMAIN with the ##HOSTNAME## token, '.' or the machine's name, such that the wmi.user value is ##HOSTNAME##\USERNAME, .\USERNAME or MACHINENAME\USERNAME.

 

WMI Services & Dependencies

All of the following services should be running and set to an "Automatic" startup type for WMI monitoring on a Windows host:

  • DCOM Server Process Launcher
  • Remote Procedure Call (RPC)
  • RPC Endpoint Mapper
  • Windows Management Instrumentation

And the following service(s) may be set to a "Manual" startup type:

  • WMI Performance Adapter

 

Using WBEMTEST for Advanced Troubleshooting

To test a WMI connection manually, you will need to run the WBEMTEST utility from the host on which the Collector is running. The following steps describe how to connect to the remote computer and pass WMI queries using the Windows WBEMTEST tool, and you can use it to quickly explore or confirm WMI details. (See the sections below for additional detail.)

Using WBEMTEST for Advanced Troubleshooting

Click Start > Run... > "wbemtest" to enter the WBEMTEST utility. Click "Connect".

Then enter the local or remote host IP into the remote namespace remote namespace field, followed by "\root\cimv2",  and credentials into Connection dialog. In the above example, we are attempting to check WMI connectivity of the host 192.168.23.1.  Click Connect3

If something is wrong that prevents WBEMTEST from connecting, a error dialog will show the reason causing the failure.

If you connection is successful, you will be returned back to the main window, this time with additional options available.

Click on Enum Classes...> toggle Recursive > OK

This should return with a list of your available WMI classes. Most normal Windows installations have 800-1200 classes.

If you do not get a list of classes returned, there may be an incompatibility between the WMI implementations of the different hosts. One workaround is to install a Collector on the same OS as the host you want to query (or on that very host.) Contact our support for additional troubleshooting and workaround options.

 

Testing WMI Access from the local host

To determine whether WMI is working correctly on the host, from the host that you are trying to query:

  1. Click Start > Run... > wbemtest
  2. Click Connect... > Leave defaults > Connect
  3. If this process fails, WMI/RPC may not running on this host, or may need to be repaired. Check out the WMI diagnosis utility from Microsoft.
    1. It is also possible that your WMI class structure may be corrupted or is inconsistent. In this case, please follow the instructions outlined on this page to repair your WMI class stucture.
  4. If it succeeds, this establishes that WMI is working correctly on the local host.

If local WMI access on the host works, you should isolate why the Collector is not able to collect data.

If permission issues are suspected, try a remote WMI connection, specifying the credentials of a domain administrator account in your network, or local administrator that is available the target machine.  If it succeeds, this establishes that WMI is working correctly on the local host and Collector machine, but the LogicMonitor services are running as an account with insufficient privileges.

If WMI is working correctly, but it cannot be accessed from a remote machine, there may be firewall issues, access right issue or DCOM issues.
See the section under Access Denied in this or this Microsoft article for more information on how to troubleshoot these issues.

 

Establishing WMI access for non-host based firewalls

When using non-host based firewalls or third-party firewalls on Windows, you will need to open specific ports to allow for WMI communication.

By default, port 24158 is used to establish WMI access. In this case, use this article provided by Microsoft to set-up WMI communication.

If you would like to use a port other than the default for WMI communication,  follow these steps:

  1. Start > Run > DCOMcnfg.exe
  2. Navigate deep into the tree to this path: Console Root > Component Services > Computers > My Computer > DCOM Config > Windows Management Instrumentation (right click on this) > Properties
  3. Click on "EndPoints" tab
  4. Click "Use static endpoint"
  5. Type in your preferred port number (make sure you choose one that is not in use in your network).

WMI Error Codes

Error: 0x800706BA RPC Server Unavailable

Possible Issues: The Windows Firewall is blocking the connection.

Quick fix: execute "netsh firewall set service RemoteAdmin enable" from command console at the monitored host (not the host on which the Collector is running). After passing this command, you can use the Windows Firewall snap-in console (wf.msc) to further tighten access to this port to be only be accessible by a certain host, user, or interface. For more information, see here. For Windows Vista and later, see here.

 

Error: 0x80070005 – Access is denied by DCOM

Possible Issues: The user does not have remote access to the computer through DCOM. Quick fix: Give the user Remote Launch and Remote Activation permissions in dcomcnfg.

  1. Click Start, click Run, type DCOMCNFG, and then click OK.
  2. In the Component Services dialog box, expand Component Services, expand Computers, and then right-click My Computer and click Properties.
  3. In the My Computer Properties dialog box, click the COM Security tab.
  4. Under Access Permissions, click Edit Limits.
  5. In the Access Permission dialog box, select the user used by Collector in the Group or user names box (for example, the following figure allows the user 'logicmonitor' to access WMI remotely). In the Allow column under Permissions for User, select Remote Access, and then click OK.
Error: 0x80070005 – Access is denied by DCOM

For more information, see here

 

Error: 0x80041003 - Access is denied by a WMI provider

Possible Issues: If a user tries to connect to a namespace they are not allowed access to, they will receive error 0x80041003. By default, this permission is enabled only for administrators. Quick fix: An administrator can enable remote access to specific WMI namespaces for a nonadministrator user.

  1. In the Control Panel, double-click Administrative Tools.
  2. In the Administrative Tools window, double-click Computer Management.
  3. In the Computer Management window, expand the Services and Applications tree.
  4. Right-click the WMI Control icon and select Properties.
  5. In the Security tab, select the namespace and click the Security button.
  6. Locate the appropriate account and check Remote Enable and Read Security in the Permissions list.
  7. Click the Advanced button and highlight the user.
  8. Click Edit...
  9. Ensure the Apply to: field is set to This namespace and subnamespaces

The following figure allows the user 'logicmonitor' to access the WMI namespace 'ROOT/CIMV2'.8

Error: 0x80041003 - Access is denied by a WMI provider

For more information, see here.

 

WBEMTEST works, but collector does not

Possible Issues: Collector uses the wrong username/password

Quick fix 1: If the device was already added into LogicMonitor, edit device's wmi.user and wmi.pass properties.

 

WMI Counter Repair

At times you may find that no matter what credentials you use and and how many security hurdles you've bypassed, you still cannot fully monitor your Windows machine. In these instances, your operating system may have a corrupted or inconsistent WMI class structure.

Other symptoms that you may be experiencing:

  1. Some WMI-collecting datasources are successfully returning data or have discovered instances, but (most) others are returning No Data.
  2. You may be experiencing unexplained errors such as "Empty result set", ox80041003, 0x80041017 from the Collector debug, WBEMTEST utility, or your custom application.
  3. You receive a different WMI result set from the Collector debug vs WBETEST, or an error from one and not the other.

Microsoft reports that this  may happen when "... certain extensible counters corrupt the registry, or if some Windows Management Instrumentation (WMI)-based programs modify the registry", but the exact nature of these issues is largely unknown and normally not worth troubleshooting extensively.

You may use the sets of WMI counter repairs below to attempt to rebuild your WMI class structure:

Registering New Counters & Restoring Default Settings

CAUTION: These steps will overwrite all custom Performance counter registry settings that you may have configured and will replace them with default configurations.

Logged in as an Administrator user, please run the following:

  1. cd c:\windows\system32
  2. lodctr /R
  3. cd c:\windows\sysWOW64
  4. lodctr /R
  5. winmgmt /clearadap
    • Note: Deprecated for Windows versions post-Windows 2008.
  6. winmgmt /verifyrepository
    • winmgmt /salvagerepository
  7. winmgmt /resyncperf
  8. sc stop WmiApSrv
  9. sc start WmiApSrv

 

Rebuilding the WMI (CIM) Counter Repository

If still having issues, or 0x80041003, "Empty result set" ; "Unexpected WMI query result", "Expecting size 1, but got size 0" errors.

Logged in as an Administrator user, please run the following:

  1. wmiadap /c
  2. wmiadap /f
  3. wmiadap /r
  4. winmgmt.exe /verifyrepository
    • winmgmt /salvagerepository
  5. winmgmt.exe /resyncperf
  6. sc stop WmiApSrv
  7. sc start WmiApSrv

 

Comprehensive WMI Class Rebuild

Logged in as an Administrator user, please run the following:

  1. Change startup type to Window Management Instrumentation (WMI) Service to "Disabled".
  2. Stop the WMI Service; you may need to stop IP Helper Service first or other dependent services before it allows you to stop WMI Service
  3. Rename the repository folder: C:\WINDOWS\system32\wbem\Repository to Repository.old
  4. Open a CMD Prompt with elevated privileges
  5. CD windows\system32\wbem
  6. for /f %s in ('dir /b /s *.dll') do regsvr32 /s %s
  7. Set the WMI Service type back to Automatic and start WMI Service
  8. cd /d c:\ ((go to the root of the c drive, this is important))
  9. for /f %s in ('dir /s /b *.mof *.mfl') do mofcomp %s

Performing a reboot after completing each fix block is ideal, but not absolutely necessary. Also, many of the above commands do not echo a response after completion, so do not be alarmed if you do not notice any changes occurring after passing a command.

Additional troubleshooting may be performed using the Windows WMI Diagnosis Utility (wmiadiag.vbs). For more information, please see this page.

 

Some Objects are Not Discovered or No Data

Occasionally, LogicMonitor will not discover an IIS instance (or some other attribute) on a Windows server. This can occur when the performance classes are not correctly registered, or when your WMI class structure is corrupt or inconsistent.

These issues can normally be corrected by running WMI counter repairs. Please see WMI counter troubleshooting for more information.

 

Recognized Issues

Windows may report No Data for page file statistics if you have a server configured for “Automatically manage paging files for all drives”, or if one of the other “Automatic” options is selected. If you assign a minimum value explicitly, then these counters will become populated.
  • Control Panel > System > Advanced tab > Performance section > Settings > Advanced tab > Virtual memory section > click "Change". In Windows 2008 and later, there is an option at the top called “Automatically manage paging file size for all drives” and you will want to set this to a value, and then back to “Automatically manage paging file size for all drives”.
There is a recognized issue in which devices will lock all classes except for win32_volume. To resolve this issue, you must fully disable UAC on the device using these steps: 
  • Locate the following reg key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\system\LocalAccountTokenFilterPolicy
  • Set the value of "LocalAccountTokenFilterPolicy" to 1
This will fully disable UAC and permit data collection from all classes. 

Additional Troubleshooting

In other cases, monitoring will stop for some objects (such as disks) while other monitoring continues correctly.

This may also indicate a WMI issue.

Some options to resolve this may be:

  • Ensure the Windows Management Instrumentation service is running.
  • Try rebooting the system.
  • For Windows 2000, Windows XP, and Windows Server 2003, download and run the WMI Diagnosis Utility
  • For Windows Vista, Server 2008, and Windows 7, run the "winmgmt /verifyrepository" command to check for an inconsistent repository

Once you have gathered the data, review the Event Logs for WMI errors.  If you have captured the output from the WMI Diagnosis Utility, review the logs and resolve any errors where possible.  Since WMI is such an integral part of Windows Operating System, please engage a Microsoft Support Engineer for assistance.