From 69e58a4410d58e4e4a1c2ed036575be8b3cf99ee Mon Sep 17 00:00:00 2001 From: Stephen Gran Date: Sat, 14 May 2011 15:35:27 +0100 Subject: [PATCH] duh, this runs on the nagios server, not on the slave - call out to do the restart Signed-off-by: Stephen Gran --- .../event_handlers/dsa-eventhandler-restart-service | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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 ;; -- 2.20.1