/usr/share/nagios3/plugins/eventhandlers/redundancy-scenario1/handle-master-host-event is in nagios3-common 3.5.1-1ubuntu1.3.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | #!/bin/sh
# REDUNDANCY EVENT HANDLER SCRIPT
# Written By: Ethan Galstad (egalstad@nagios.org)
# Last Modified: 02-19-2004
#
# 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="/usr/bin/mail"
# Location of the event handlers
eventhandlerdir="/usr/share/nagios3/plugins/eventhandlers"
# Only take action on hard host states...
case "$2" in
HARD)
case "$1" in
DOWN)
# The master host has gone down!
# We should now become the master host and take
# over the responsibilities of monitoring the
# network, so enable notifications...
`$eventhandlerdir/enable_notifications`
# Notify someone of what has happened with the original
# master server and our taking over the monitoring
# responsibilities. No one was notified of the master
# host going down, since the notification would have
# occurred while we were in standby mode, so this is a good idea...
#`$echocmd "Master Nagios host is down!" | /bin/mail -s "Master Nagios Host Is Down" root@localhost`
#`$echocmd "Slave Nagios host has entered ACTIVE mode and taken over network monitoring responsibilities!" | $mailcmd -s "Slave Nagios Host Has Entered ACTIVE Mode" root@localhost`
;;
UP)
# The master host has recovered!
# We should go back to being the slave host and
# let the master host do the monitoring, so
# disable notifications...
`$eventhandlerdir/disable_notifications`
# Notify someone of what has happened. Users were
# already notified of the master host recovery because we
# were in active mode at the time the recovery happened.
# However, we should let someone know that we're switching
# back to standby mode...
#`$echocmd "The master Nagios host has recovered, so the slave Nagios host has returned to standby mode..." | $mailcmd -s "Slave Nagios Host Has Returned To STANDBY Mode" root@localhost`
;;
esac
;;
esac
exit 0
|