Pandora FMS Community

Pandora Agent WMI query using non-standard namespace

FMSer · 17 nov 2010, 20:55 · 2 mensajes · 57 visitas

  1. Inicio del debate

    I would like to add a module to my LDAP server to get some AD information.  As an example, I can run the following WMIC query to get an email address from the Pandora server: wmic --namespace="rootdirectoryLDAP" -U "DOMAINuser"%MyPassword //AD-DC1 "Select ds_mail From ds_user WHERE ds_samaccountname='userID'" I have obviously removed the sensitive info, but can a pandora_agent.conf file use this different namespace, or any other non ROOTCIMv2 namespace? Thanks.

  2. You can create a vbs file like this (check syntax and options, but the idea is this): Set objWMI = GetObject("winmgmts:rootdirectoryLDAP") Set colObjets = objWMI.ExecQuery _ (-U "DOMAINuser"%MyPassword //AD-DC1 "Select ds_mail From ds_user WHERE ds_samaccountname='userID'") For Each objObjet in colObjets WScript.Echo (objObjet.ds_mail) Next Save it like mail.vbs and test if it works (gives your desired output) with cscript //Nologo mail.vbs Then, add an exec module like: module_begin module_name Mail module_type generic_data_string module_exec cscript //Nologo mail.vbs module_description Mail module_end Of course, change at will. cscript //Nologo mail.vbs

Entra en tu cuenta para publicar.