From: Stephen Gran Date: Sat, 14 May 2011 15:22:26 +0000 (+0100) Subject: ah, this needs to know when to run as well X-Git-Url: https://wiki.adam-barratt.org.uk/gitweb/?a=commitdiff_plain;h=6e5c9809c7aa7e03ae8729fa5aa018b365969e80;p=mirror%2Fdsa-nagios.git ah, this needs to know when to run as well Signed-off-by: Stephen Gran --- diff --git a/dsa-nagios-checks/event_handlers/dsa-eventhandler-restart-service b/dsa-nagios-checks/event_handlers/dsa-eventhandler-restart-service index 19ba0d2..5551dd1 100755 --- a/dsa-nagios-checks/event_handlers/dsa-eventhandler-restart-service +++ b/dsa-nagios-checks/event_handlers/dsa-eventhandler-restart-service @@ -17,20 +17,12 @@ state="$1" type="$2" attempt="$3" host="$4" -service="$5" +starton="$5" +service="$6" # What state is the service in? case "${state}" in - OK) - # The service just came back up, so don't do anything... - ;; - WARNING) - # We don't really care about warning states, since the service is probably still running... - ;; - UNKNOWN) - # We don't know what might be causing an unknown error, so don't do anything... - ;; - CRITICAL) + "${starton}") # Aha! The service appears to have a problem - perhaps we should restart it # Is this a "soft" or a "hard" state? case "${type}" in