I'm trying to use Zabbix for monitoring CPU usage by different processes on Windows Server. Processes to monitor are not determined upfront. I want to use LLD to monitor top 3 CPU demanding processes.
Currently I've created a discovery rule that returns top 3 CPU demanding processes at given moment, for example:
{
{
"name":"DistributedCacheService",
"value":"9238.09375"
},
{
"name":"System",
"value":"6649.234375"
},
{
"name":"svchost",
"value":"5224.40625"
}
}
Then I've created macros using json paths and item prototype and that's where i started to experience problems. I'm using earlier created LLD macro for item name and I'm using system.run command for obtaning a value in key field. Item name is supposed to process name and item key, value is supposed the CPU usage by that process. [enter image description here][1] [1]: https://i.stack.imgur.com/HuNbd.png
When testing discovery rule and item prototype everything runs fine, but when i try to run that discovery rule I get an error
"Cannot create item: item with the same key "system.run[powershell.exe -nolog -command "(Get-Process | Sort-Object CPU -desc | Select-Object -index 0 | Format-Table -Aut...]" already exists."
Firstly, there is no other item with the same key.
Secondly, when my discovery rule will detect other processes, there will have to be created other items with the same key. Other names, but the same key
Is it even possible to create processes CPU usage monitoring using LLD? I don't want to be stuck with predefined processes, I would like to have them dynamicly added with LLD.