I am trying to get agents to report in powershell commands with multiple select arguments. I am starting to think it is impossible, I am at the end of my wits here.
In a template for my client computers, I have an item with the following keys (for example):
All of them works fine, both from a powershell locally, and the zabbix client reports in.
But the moment I try to select more properties like so:
.. I get an error message stating that the command "is not supported: Invalid second parameter."
I have also tried:
.. With the same result, Invalid second parameter.
All of the above works fine directly from a powershell, obviously without the system.run-wrapper.
This is a complete error message from the zabbix agent:
I suspect the comma somehow borks things and need to be escaped somehow, I just don't know how.
Any black belts out there with any ideas ?
In a template for my client computers, I have an item with the following keys (for example):
Code:
system.run[powershell.exe -c "get-localuser"] system.run[powershell.exe -c "get-localuser | select name"] system.run[powershell.exe -c "get-localuser | select name | fl"] system.run[powershell.exe -c "get-localuser | select *"]
All of them works fine, both from a powershell locally, and the zabbix client reports in.
But the moment I try to select more properties like so:
Code:
system.run[powershell.exe -c "get-localuser | select name,lastlogon"]
I have also tried:
Code:
system.run[powershell.exe -c "& {get-localuser | select-object -property "name,lastlogon"}"]
All of the above works fine directly from a powershell, obviously without the system.run-wrapper.
This is a complete error message from the zabbix agent:
Code:
10620:20210708:131005.770 active check "system.run[powershell.exe -c "& {get-localuser | select-object -property "name,lastlogon"}"]" is not supported: Invalid second parameter.
Any black belts out there with any ideas ?
Comment