⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 handle-master-host-event

📁 Nagios is a powerful host and service monitoring program designed to run on most *NIX systems. It is
💻
字号:
#!/bin/sh# REDUNDANCY EVENT HANDLER SCRIPT# Written By: Ethan Galstad (nagios@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 commandsechocmd="/bin/echo"mailcmd="/bin/mail"# Location of the event handlerseventhandlerdir="/usr/local/nagios/libexec/eventhandlers"# Only take action on hard host states...case "$2" inHARD)	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	;;esacexit 0

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -