I am trying to fetch windows process metrics and facing some difficulties. To begin with I created a new template, added a discovery rule and named the key win.process.metrics
Then I created 2 item prototype with following key.
Type Zabbix Agent(Active): win.process.metrics[{#PID}]
Type Dependent Item: win.process.metrics[{#PROCESSNAME}]
I created 2 LLD macros for the same
{#PROCESSNAME} = $.ProcessName
{#PID}=$.Id
Then I created userparameter in zabbixAgent conf file
UserParameter=metric.process.discovery,powershell -NoProfile -ExecutionPolicy Bypass -File "C:\Program Files\Zabbix Agent\scripts\ProcessMetrics.ps1"
Content of the PowerShell script
Get-Process | Select ProcessName, Id, Description | ConvertTo-Json -Compress
Here is the sample result
[
{"ProcessName":"chrome","Id":1232,"Description":"G oogle Chrome"},
{"ProcessName":"chrome","Id":1500,"Description":"G oogle Chrome"}
]
When I enable the item prototype, I see that data is ingesting however for PID process I see item does allow parameters
error
I would like to know how can I ingest multiple key value pairs using one discovery rule. Is it possible in first place?
Appreciate your guidance in resolving this issue.