X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=dsa-nagios-checks%2Fevent_handlers%2Fdsa-eventhandler-restart-service;fp=dsa-nagios-checks%2Fevent_handlers%2Fdsa-eventhandler-restart-service;h=19ba0d2a76c322ad84631245661e522c1bc78ef1;hb=69e58a4410d58e4e4a1c2ed036575be8b3cf99ee;hp=278ddeee20c33388f500979dc4f293999d1dd2e0;hpb=8cf0eb595cc722da0dc9b88235138806b88d937c;p=mirror%2Fdsa-nagios.git diff --git a/dsa-nagios-checks/event_handlers/dsa-eventhandler-restart-service b/dsa-nagios-checks/event_handlers/dsa-eventhandler-restart-service index 278ddee..19ba0d2 100755 --- a/dsa-nagios-checks/event_handlers/dsa-eventhandler-restart-service +++ b/dsa-nagios-checks/event_handlers/dsa-eventhandler-restart-service @@ -10,12 +10,14 @@ # $1 $SERVICESTATE$ # $2 $SERVICESTATETYPE$ # $3 $SERVICEATTEMPT$ +# $4 $HOSTADDRESS$ # $4 init script name state="$1" type="$2" attempt="$3" -service="$4" +host="$4" +service="$5" # What state is the service in? case "${state}" in @@ -46,7 +48,7 @@ case "${state}" in # fixed the problem! 3) # Call the init script to restart the HTTPD server - sudo /etc/init.d/${service} restart + /usr/lib/nagios/plugins/check_nrpe -n -H "${host}" -c "${service}" ;; esac ;; @@ -56,7 +58,7 @@ case "${state}" in # Note: Contacts have already been notified of a problem with the service at this # point (unless you disabled notifications for this service) HARD) - sudo /etc/init.d/${service} restart + /usr/lib/nagios/plugins/check_nrpe -n -H "${host}" -c "${service}" ;; esac ;;