Ad Widget

Collapse

Zabbix agent and powershell :'(

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • aherrmann
    Junior Member
    • Oct 2016
    • 2

    #1

    Zabbix agent and powershell :'(

    Loved Zabbix user,

    i have gat a problem with the zabbix agent (3.2) under windows...

    I'm trying to auto discover network shares with something like this:

    Code:
    UserParameter=smb.discover,%systemroot%\system32\windowspowershell\v1.0\powershell.exe -NoProfile -ExecutionPolicy Bypass -nologo -c "ConvertTo-Json -InputObject @($ary=@{}; $ary[\"data\"] = @(Get-SmbShare); $ary) -Compress -Depth 1"
    the statement alone give me a:
    Code:
    [{"data":"MSFT_SmbShare (Name = \"ADMIN?\", ScopeName = \"*\") MSFT_SmbShare (Name = \"C?\", ScopeName = \"*\") MSFT_SmbShare (Name = \"IPC?\", ScopeName = \"*\") MSFT_SmbShare (Name = \"MapEditor\", ScopeName = \"*\") MSFT_SmbShare (Name = \"print?\", ScopeName = \"*\") MSFT_SmbShare (Name = \"Users\", ScopeName =\"*\")"}]
    but when i try to test it from zabbix agent it fail...
    Code:
    C:\Program Files\Zabbix Agent>zabbix_agentd.exe -c "C:\Program Files\Zabbix Agent>zabbix_agentd.conf" -t smb.discover
    smb.discover                                  [m|ZBX_NOTSUPPORTED] Unsupported item key.]
    hope sombody got a tip for me^^
Working...