handle-master-proc-event

来自「Nagios is a powerful host and service mo」· 代码 · 共 59 行

TXT
59
字号
#!/bin/sh# REDUNDANCY EVENT HANDLER SCRIPT# Written By: Ethan Galstad (nagios@nagios.org)# Last Modified: 05-30-2006## 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 service states...case "$2" inHARD)	case "$1" in	CRITICAL)		# The master Nagios process is not running!		# We should now become the master host and		# take over the responsibility of monitoring		# the network, so enable active checks...		`$eventhandlerdir/enable_active_service_checks`		;;	WARNING|UNKNOWN)		# The master Nagios 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 Nagios process running again!		# We should go back to being the slave host, 		# so disable active checks		`eventhandlerdir/disable_active_service_checks`		;;	esac	;;esacexit 0 

⌨️ 快捷键说明

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