Server Fault Asked on December 13, 2021
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 FilesZabbix AgentscriptsProcessMetrics.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.
You are calling a user parameter metric.process.discovery with [PID] as a parameter in each item, but you didn't configure this userparameter to work with parameters. You just can run metric.process.discovery WITHOUT parameters.
What you expect to receive in each item ?
Answered by Kevin Yan on December 13, 2021
I would try to stop using user parameter, I've achieved similar results by enabling remote commands and using system.run as a main part of key, that way you don't have to use user parameters and you can acheive basically anything, you only have to be carefull when you try to use commans in key, but there are available some workaorunds. Feel free to ask more questions, I've been dealing with those type of problems for a while.
Answered by Paweł Zimny on December 13, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP