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

1 Like
#3

I have a Windows admin looking at this, and WSMan is not an option for some of our legacy servers due to requirement for Win2K3 R2 or greater to be able to run WSMan…

So we are back to trying to get WMI working.

While not directly related to OpenNMS, this link seems to suggest that the code in that case which was using jInterop was misconfigured and was trying to do the initial connection with the “Guest” account which was disabled. How can I increase the debugging output of checkwmi to be able to see all the interactions between checkwmi and the windows server. The windows Admin says there is nothing wrong with the windows account being used by OpenNMS, as he can query WMI directly from powershell, which is why I want to see how jInterop is interacting.

Regards,
John