Windows Service Check With Action
This commit is contained in:
@@ -1,6 +0,0 @@
|
||||
#Eseguo Get-Service per ottenere informazioni riguardo il servizio desiderato
|
||||
$Response = Get-Service "NomeServizio"
|
||||
#Se il servizio ha status = stopped faccio qualcosa tipo inviare a zabbix informazioni
|
||||
if ($Response.Status -eq "Stopped" ) {
|
||||
#& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ovh -s "WIN2019IIS.OVH" -k RedisSentinel.Failure -o 1
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
#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
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
#Eseguo Get-Service per ottenere informazioni riguardo il servizio desiderato
|
||||
$Response = Get-Service "Redis"
|
||||
#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 Redis.Failure -o 0
|
||||
echo 0
|
||||
}
|
||||
else {
|
||||
& "C:\Program Files\Zabbix Agent\zabbix_sender.exe" -z zabproxy.ovh -s "WIN2019IIS.OVH" -k Redis.Failure -o 1
|
||||
echo 1
|
||||
}
|
||||
Reference in New Issue
Block a user