Forum Discussion

The_Other_Josh's avatar
5 years ago

Groovy WMI documentation

Is there any documentation for the Groovy WMI implementation (com.santaba.agent.groovyapi.win32.WMI and com.santaba.agent.groovyapi.win32.WMISession)?  I wasn't able to find anything in a short search.

In particular, none of the examples that I found in LM check for WMI credential properties (wmi.user and wmi.pass).

  • I found only one instance of WMI.open() in the datasource set we have loaded -- in Citrix_XenApp_UserExperience:

    def session = WMI.open(hostname);
    def active_apps = session.queryAll(namespace, "SELECT * from Citrix_Euem_ClientStartup", 15);

    The implication is it would have to handle wmi.user/wmi.pass behind the scenes.  All other references are for WMI.queryAll and WMI.queryFirst with the same implication.  If none of the modules properly handle those properties, then there are a lot of broken modules:

    [mnagel@colby datasources]$ egrep -l 'WMI\.(query|open)' *
    Citrix_XenApp_UserExperience
    LogicMonitor_Collector_TotalCPUMemory
    Microsoft_Exchange_ActiveDirectoryDomainControllers_2016+
    Microsoft_Exchange_EdgeTransportDatabaseInstances_2016+
    Microsoft_Exchange_EdgeTransportDatabases_2016+
    Microsoft_Exchange_MailboxDatabaseInstances_2016+
    Microsoft_Exchange_MailboxDatabases_2016+
    Microsoft_Exchange_MailboxOverview_2016+
    Microsoft_Exchange_Replication_2016+
    Microsoft_Exchange_TransportQueueOverview_2016+
    Microsoft_Exchange_UnifiedMessaging_2016+
    Microsoft_LyncMediationServer_Stats
    Microsoft_LyncServer_AccessEdgeServerStats
    Microsoft_LyncServer_Authentication
    Microsoft_LyncServer_BackupCentralManagementModule
    Microsoft_LyncServer_ClusterManager
    Microsoft_LyncServer_ConferencingAttendant
    Microsoft_LyncServer_Datastores
    Microsoft_LyncServer_EmergencyCallRouting
    Microsoft_LyncServer_InstantMessaging
    Microsoft_LyncServer_MCU
    Microsoft_LyncServer_Messages
    Microsoft_LyncServer_Networking
    Microsoft_LyncServer_Protocol
    Microsoft_LyncServer_Routing
    Microsoft_LyncServer_RoutingApps
    Microsoft_LyncServer_StorageService
    Microsoft_LyncServer_WebServices
    Microsoft_LyncServer_XMPPProxy
    WinCPU
    Win_WMI_Access_Denied_ErrorCodes
    Win_WMI_UACTroubleshooter

  • Anonymous's avatar
    Anonymous

    I found our internal documentation and still couldn't find anything about how to pass credentials or an example passing credentials.  In fact, it looks like that class was specifically built to "inherit a devices authentication, etc.". Since each collection task defined on a collector has the details of all properties on a device when the task is created, it's quite possible that it does use wmi.user/wmi.pass at runtime, even if you haven't pulled them into the groovy script via hostProps.get().

    I've put in the request to have this documentation published in the support docs, but I don't think it will help. In the same request, i've asked that they detail whether or not wmi.user/wmi.pass can be passed in as explicit parameters to WMI.open(), WMI.queryFirst(), and WMI.queryAll(). 

  • I'm pretty sure that it doesn't do anything automatically with the properties.  The issue we are working on is related to access rights on the service account vs the WMI account, which is why I wanted to do some testing while specifying different accounts.  The WinCPU datasource is not working (it doesn't reference the properties) but other WMI data collection is fine.

    I am working with support but was checking here in parallel in case someone had the information readily available.

  • I suspect that the WMISession class automatically uses the wmi.* properties when it exists. I suggest you reach out to your rep or talk with support.