Powershell zabbix
Powershell で書くzabbix
zabbix_agentd.confに書くらしい。
Userparameter=vm.state,powershell.exe -NoProfile -ExecutionPolicy Bypass -file “C:\test.ps1”
スクリプトの中身は
— test.ps1
$Health = "poi"
foreach($State in $Health){
if($state.Health -match "Normal"){
$output = 2
}else{
$output = 1
}
}
write-host $output
実行@zabbix server
zabbix_get -s
結果
1
バグがあると ZBX_NOTSUPPORTED が戻るらしい。