From 6e5c9809c7aa7e03ae8729fa5aa018b365969e80 Mon Sep 17 00:00:00 2001 From: Stephen Gran Date: Sat, 14 May 2011 16:22:26 +0100 Subject: [PATCH] ah, this needs to know when to run as well Signed-off-by: Stephen Gran --- .../dsa-eventhandler-restart-service | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) 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 -- 2.20.1