11 lines
521 B
PowerShell
11 lines
521 B
PowerShell
#Eseguo Get-Service per ottenere informazioni riguardo il servizio desiderato
|
|
$Response = Get-Service "Redis Sentinel"
|
|
#Se il servizio ha status = stopped faccio qualcosa tipo inviare a zabbix informazioni
|
|
if ($Response.Status -eq "Running" ) {
|
|
& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ovh -s "WIN2019IIS.OVH" -k RedisSentinel.Failure -o 0
|
|
echo 0
|
|
}
|
|
else {
|
|
& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ovh -s "WIN2019IIS.OVH" -k RedisSentinel.Failure -o 1
|
|
echo 1
|
|
} |