Hi!
I create custom ldd rule with UserParameter
It returns json object as said in docs
Example:
Most of received processes are services too so item was created for them before by standard template. But items was created not for all procs from list . I added only 1 macro {#PROC.NAME} with jsonpath $.data. My template for discovered item has this key proc_info[{#PROC.NAME}].
I receive problem in zabbix:
If i try to search item, for example, for "vncserver", i find it(it's service because), but if i try "vncserverui", i dont(not a service).
So what i do wrong? Thanks
P.S. I tried another key, but got the same error
I create custom ldd rule with UserParameter
Code:
UserParameter=system.processes,powershell -command "$proc = Get-Process | select-object ProcessName | Sort-Object | Get-Unique -AsString; $json=@(ConvertTo-Json $proc); $names='{ \"data\": }'; $names=$names.Insert(9,$json); $names.replace('ProcessName','{#PROC.NAME}'); "
Example:
Code:
zabbix_get -s server.name -k system.processes
{ "data":[
{
"{#PROC.NAME}": "svchost"
},
{
"{#PROC.NAME}": "sqlwriter"
},
{
"{#PROC.NAME}": "spoolsv"
},
{
"{#PROC.NAME}": "smss"
},
{
"{#PROC.NAME}": "snmp"
},
{
"{#PROC.NAME}": "sqlservr"
},
{
"{#PROC.NAME}": "svchost"
},
{
"{#PROC.NAME}": "vds"
},
{
"{#PROC.NAME}": "vncagent"
},
{
"{#PROC.NAME}": "taskhostw"
},
{
"{#PROC.NAME}": "UpdaterDisabler"
},
{
"{#PROC.NAME}": "vncserver"
},
{
"{#PROC.NAME}": "winlogon"
},
{
"{#PROC.NAME}": "zabbix_agentd"
},
{
"{#PROC.NAME}": "vncserverui"
},
{
"{#PROC.NAME}": "wininit"
},
{
"{#PROC.NAME}": "System"
},
{
"{#PROC.NAME}": "svchost"
},
{
"{#PROC.NAME}": "sihost"
},
{
"{#PROC.NAME}": "dfsrs"
},
{
"{#PROC.NAME}": "dfssvc"
},
{
"{#PROC.NAME}": "csrss"
},
{
"{#PROC.NAME}": "distnoted"
},
{
"{#PROC.NAME}": "dwm"
},
{
"{#PROC.NAME}": "explorer"
},
{
"{#PROC.NAME}": "dllhost"
},
{
"{#PROC.NAME}": "dns"
},
{
"{#PROC.NAME}": "conhost"
},
{
"{#PROC.NAME}": "AppleMobileDeviceService"
},
{
"{#PROC.NAME}": "audiodg"
},
{
"{#PROC.NAME}": "alg"
},
{
"{#PROC.NAME}": "AppleMobileDeviceHelper"
},
{
"{#PROC.NAME}": "cmd"
},
{
"{#PROC.NAME}": "conhost"
},
{
"{#PROC.NAME}": "cmd"
},
{
"{#PROC.NAME}": "conhost"
},
{
"{#PROC.NAME}": "GoogleCrashHandler"
},
{
"{#PROC.NAME}": "notepad"
},
{
"{#PROC.NAME}": "powershell"
},
{
"{#PROC.NAME}": "mmc"
},
{
"{#PROC.NAME}": "msdtc"
},
{
"{#PROC.NAME}": "RuntimeBroker"
},
{
"{#PROC.NAME}": "services"
},
{
"{#PROC.NAME}": "ShellExperienceHost"
},
{
"{#PROC.NAME}": "SearchUI"
},
{
"{#PROC.NAME}": "ServerManager"
},
{
"{#PROC.NAME}": "Microsoft.ActiveDirectory.WebServices"
},
{
"{#PROC.NAME}": "iashost"
},
{
"{#PROC.NAME}": "Idle"
},
{
"{#PROC.NAME}": "GoogleCrashHandler64"
},
{
"{#PROC.NAME}": "GoogleUpdate"
},
{
"{#PROC.NAME}": "lsass"
}
] }
I receive problem in zabbix:
Code:
Cannot create item: item with the same key "proc_info[{#PROC.NAME}]" already exists.
Cannot create item: item with the same key "proc_info[{#PROC.NAME}]" already exists.
Cannot create item: item with the same key "proc_info[{#PROC.NAME}]" already exists.
...
So what i do wrong? Thanks
P.S. I tried another key, but got the same error
Code:
Cannot create item: item with the same key "perf_counter[\Process({#PROC.NAME})\% Processor Time]" already exists.
Cannot create item: item with the same key "perf_counter[\Process({#PROC.NAME})\% Processor Time]" already exists.
Cannot create item: item with the same key "perf_counter[\Process({#PROC.NAME})\% Processor Time]" already exists...
Comment