#!/bin/bash
# Watch nagios status retention file

FILE=/var/cache/nagios/status.sav

[ -z $1 ] || FILE=$1

if [ ! -f $FILE ] ; then
	echo "No Retention File found."
	exit 3
fi

grep "^PROGRAM\:\ 1\;.*" $FILE >/dev/null
STATUS="$?"

case "$STATUS" in
	0)
		echo "Notifications are turned on."
		exit 0
		;;
	1)
		echo "Notifications are turned OFF!"
		exit 1
		;;
	*)
		echo "Strange things happen."
		exit 3
		;;
esac
