Testing WMI connectivity


#1

I’m trying to set up WMI monitoring, and I cannot get it to work at all against a Win 2016 server.

I can get the checkwmi command to work against a Win2008 server using an account with Domain Admin access. But trying to set up an account with a lower level of access is failing.

I’m getting the following error from checkwmi when trying to test:

org.opennms.protocols.wmi.WmiException: Failed to establish COM session with host ‘10.161.30.20’: Access is denied, please check whether the [domain-username-password] are correct. Also, if not already done please check the GETTING STARTED and FAQ sections in readme.htm. They provide information on how to correctly configure the Windows machine for DCOM access, so as to avoid such exceptions. [0x00000005]
at org.opennms.protocols.wmi.WmiClient.connect(WmiClient.java:263)
at org.opennms.protocols.wmi.WmiManager.init(WmiManager.java:264)
at org.opennms.protocols.wmi.CheckWmi.main(CheckWmi.java:149)
Caused by: org.jinterop.dcom.common.JIException: Access is denied, please check whether the [domain-username-password] are correct. Also, if not already done please check the GETTING STARTED and FAQ sections in readme.htm. They provide information on how to correctly configure the Windows machine for DCOM access, so as to avoid such exceptions. [0x00000005]
at org.jinterop.winreg.smb.JIWinRegStub.winreg_OpenKey(JIWinRegStub.java:197)
at org.jinterop.dcom.core.JIProgId.getIdFromWinReg(JIProgId.java:131)
at org.jinterop.dcom.core.JIProgId.getCorrespondingCLSID(JIProgId.java:162)
at org.jinterop.dcom.core.JIComServer.(JIComServer.java:413)
at org.opennms.protocols.wmi.WmiClient.connect(WmiClient.java:232)
… 2 more
Caused by: org.jinterop.dcom.common.JIRuntimeException: Access is denied, please check whether the [domain-username-password] are correct. Also, if not already done please check the GETTING STARTED and FAQ sections in readme.htm. They provide information on how to correctly configure the Windows machine for DCOM access, so as to avoid such exceptions. [0x00000005]
at org.jinterop.winreg.IJIWinReg$openKey.read(IJIWinReg.java:939)
at ndr.NdrObject.decode(NdrObject.java:36)
at rpc.ConnectionOrientedEndpoint.call(ConnectionOrientedEndpoint.java:137)
at rpc.Stub.call(Stub.java:113)
at org.jinterop.winreg.smb.JIWinRegStub.winreg_OpenKey(JIWinRegStub.java:191)
… 6 more

Is there some way to increase debugging output of checkwmi so that we can see what part of the wmi access is failing?

The monitoring account we are setting up works for WMI queries from powershell.

Any pointers to get WMI monitoring working would be greatly appreciated.

Regards,
John


#2

My recommendation is don’t; I would use wsman instead.

But I recall this being required for wmi to work remotely: https://wiki.opennms.org/wiki/WmiConfiguration#Manual_registry_permission_configuration_using_regedit