# $1 $SERVICESTATE$
# $2 $SERVICESTATETYPE$
# $3 $SERVICEATTEMPT$
+# $4 $HOSTADDRESS$
# $4 init script name
state="$1"
type="$2"
attempt="$3"
-service="$4"
+host="$4"
+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
# 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
;;
# 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
;;