obsessive_svc_handler

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

TXT
47
字号
#!/bin/sh# OBSESSIVE_SVC_HANDLER# Written by Ethan Galstad (nagios@nagils.org)# Last Modified: 07-19-2001## This script is intended to run as the OCSP command# on a distributed monitoring server.  The script calls# submit_check_result_via_nsca to send the service check# results to the central monitoring server.## Arguments:#  $1 = host_name (Short name of host that the service is#       associated with)#  $2 = svc_description (Description of the service)#  $3 = state_string (A string representing the status of#       the given service - "OK", "WARNING", "CRITICAL"#       or "UNKNOWN")#  $4 = plugin_output (A text string that should be used#       as the plugin output for the service checks)## Location of the submit_check_result_via_nsca scriptSubmitCmd="/usr/local/nagios/libexec/eventhandlers/submit_check_result_via_nsca"# Convert the state string to the corresponding return codereturn_code=-1case "$3" in	OK)		return_code=0		;;	WARNING)		return_code=1		;;	CRITICAL)		return_code=2		;;	UNKNOWN)		return_code=3		;;esac# Send the service check results to the central monitoring server$SubmitCmd "$1" "$2" $return_code "$4"

⌨️ 快捷键说明

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