#!/bin/sh

# REDUNDANCY EVENT HANDLER SCRIPT
# Written By: Ethan Galstad (netsaint@linuxbox.com)
# Last Modified: 01-14-2000
#
# This is an example script for implementing redundancy.
# Read the HTML documentation on redundant monitoring for more
# information on what this does.

# Location of the echo and mail commands
echocmd="/bin/echo"
mailcmd="/bin/mail"

# Location of the event handlers
eventhandlerdir="/usr/local/netsaint/libexec/eventhandlers"


# Only take action on hard service states...
case "$2" in
HARD)

	case "$1" in
	CRITICAL)

		# The master NetSaint process is not running!
		# We should now become the master host and
		# take over the responsibility of monitoring
		# the network, so enter active mode...

		`$eventhandlerdir/enter_active_mode`
		;;

	WARNING)
	UNKNOWN)

		# The master NetSaint process may or may not
		# be running.. We won't do anything here, but
		# to be on the safe side you may decide you 
		# want the slave host to become the master in
		# these situations...
		;;

	OK)

		# The master NetSaint process running again!
		# We should go back to being the slave host, 
		# so enter standby mode...

		`eventhandlerdir/enter_standby_mode`
		;;

	esac
	;;

esac
exit 0

 
