UserParameter, PowerShell, invoke script.ps1 with arguments, Zabbix

UserParameter=power.invoke,powershell -NoProfile -ExecutionPolicy Bypass -File "C:\zabbix\redisinfo.ps1" -MachineName %computername% -Property cpu
redisinfo.ps1:
param (
    $MachineName,
    $Property
)

$a = R:\redis\bin\redis-cli -h $MachineName INFO | select-string "${Property}:" 
[regex]::match($a,':(.*)').Groups[1].Value

No comments: