Hello everyone,
I'm trying to run a powershell script through the agent, to return a percentage. The script should return a raw number that represents a percentage, no decimals, no headers, not even the "blank space" on the headers that would return with the ft -hide option nor the "%" symbol. Just the number.
After enabling remote commands on the agent config, I'm running the script with the following key on an item:
system.run[powershell.exe -NoLogo -NonInteractive -ExecutionPolicy Bypass -File " C:\zabbix\scripts\scripttest.ps1",nowait]
The item is enabled, but it's returning a constant value of 1. I believe it's the exit code, and 1 should be "the script ran successfuly" or something alike, but I'd like to receive the script output, yet, I don't know how to make zabbix return the value. Has anyone got to deal with this issue?
Thanks in advance!
I'm trying to run a powershell script through the agent, to return a percentage. The script should return a raw number that represents a percentage, no decimals, no headers, not even the "blank space" on the headers that would return with the ft -hide option nor the "%" symbol. Just the number.
After enabling remote commands on the agent config, I'm running the script with the following key on an item:
system.run[powershell.exe -NoLogo -NonInteractive -ExecutionPolicy Bypass -File " C:\zabbix\scripts\scripttest.ps1",nowait]
The item is enabled, but it's returning a constant value of 1. I believe it's the exit code, and 1 should be "the script ran successfuly" or something alike, but I'd like to receive the script output, yet, I don't know how to make zabbix return the value. Has anyone got to deal with this issue?
Thanks in advance!
Comment