📄 commands.cfg.in
字号:
################################################################################# Sample command definitions for Nagios @VERSION@## Read the documentation for more information on this configuration file. I've# provided some comments here, but things may not be so clear without further# explanation, so make sure to read the HTML documentation!# # Last Modified: 11-21-2006################################################################################################################################################################## COMMAND DEFINITIONS## SYNTAX:## define command{# template <templatename># name <objectname># command_name <commandname># command_line <commandline># }## WHERE:## <templatename> = object name of another command definition that should be# used as a template for this definition (optional)# <objectname> = object name of command definition, referenced by other# command definitions that use it as a template (optional)# <commandname> = name of the command, as recognized/used by Nagios# <commandline> = command line################################################################################################################################################################### SAMPLE SERVICE CHECK COMMANDS## These are some example service check commands. They may or may not work on# your system, as they must be modified for your plugins. See the HTML # documentation on the plugins for examples of how to configure command definitions.################################################################################################################################################################## NOTE: The following 'check_local_...' functions are designed to monitor# various metrics on the host that Nagios is running on (i.e. this one).################################################################################# 'check_local_disk' command definitiondefine command{ command_name check_local_disk command_line $USER1$/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$ }# 'check_local_load' command definitiondefine command{ command_name check_local_load command_line $USER1$/check_load -w $ARG1$ -c $ARG2$ }# 'check_local_procs' command definitiondefine command{ command_name check_local_procs command_line $USER1$/check_procs -w $ARG1$ -c $ARG2$ -s $ARG3$ }# 'check_local_users' command definitiondefine command{ command_name check_local_users command_line $USER1$/check_users -w $ARG1$ -c $ARG2$ }################################################################################# NOTE: The following 'check_...' commands are used to monitor services on# both local and remote hosts.################################################################################# 'check_dns' command definitiondefine command{ command_name check_dns command_line $USER1$/check_dns -H www.yahoo.com -s $HOSTADDRESS$ }# 'check_ftp' command definitiondefine command{ command_name check_ftp command_line $USER1$/check_ftp -H $HOSTADDRESS$ }# 'check_hpjd' command definitiondefine command{ command_name check_hpjd command_line $USER1$/check_hpjd -H $HOSTADDRESS$ -C public }# 'check_http' command definitiondefine command{ command_name check_http command_line $USER1$/check_http -H $HOSTADDRESS$ }# 'check_nntp' command definitiondefine command{ command_name check_nntp command_line $USER1$/check_nntp -H $HOSTADDRESS$ }# 'check_ping' command definitiondefine command{ command_name check_ping command_line $USER1$/check_ping -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p 5 }# 'check_pop' command definitiondefine command{ command_name check_pop command_line $USER1$/check_pop -H $HOSTADDRESS$ }# 'check_smtp' command definitiondefine command{ command_name check_smtp command_line $USER1$/check_smtp -H $HOSTADDRESS$ }# 'check_tcp' command definitiondefine command{ command_name check_tcp command_line $USER1$/check_tcp -H $HOSTADDRESS$ -p $ARG1$ }# 'check_telnet' command definitiondefine command{ command_name check_telnet command_line $USER1$/check_tcp -H $HOSTADDRESS$ -p 23 }# 'check_udp' command definitiondefine command{ command_name check_udp command_line $USER1$/check_udp -H $HOSTADDRESS$ -p $ARG1$ }################################################################################## SAMPLE HOST CHECK COMMANDS################################################################################## This command checks to see if a host is "alive" by pinging it# The check must result in a 100% packet loss or 5 second (5000ms) round trip # average time to produce a critical error.# Note: Only one ICMP echo packet is sent (determined by the '-p 1' argument)# 'check-host-alive' command definitiondefine command{ command_name check-host-alive command_line $USER1$/check_ping -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100% -p 1 }################################################################################## SAMPLE NOTIFICATION COMMANDS## These are some example notification commands. They may or may not work on# your system without modification. As an example, some systems will require # you to use "/usr/bin/mailx" instead of "/usr/bin/mail" in the commands below.################################################################################## 'host-notify-by-email' command definitiondefine command{ command_name host-notify-by-email command_line /usr/bin/printf "%b" "***** Nagios @VERSION@ *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | @MAIL_PROG@ -s "Host $HOSTSTATE$ alert for $HOSTNAME$!" $CONTACTEMAIL$ }# 'host-notify-by-epager' command definitiondefine command{ command_name host-notify-by-epager command_line /usr/bin/printf "%b" "Host '$HOSTALIAS$' is $HOSTSTATE$\nInfo: $HOSTOUTPUT$\nTime: $LONGDATETIME$" | @MAIL_PROG@ -s "$NOTIFICATIONTYPE$ alert - Host $HOSTNAME$ is $HOSTSTATE$" $CONTACTPAGER$ }# 'notify-by-email' command definitiondefine command{ command_name notify-by-email command_line /usr/bin/printf "%b" "***** Nagios @VERSION@ *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$" | @MAIL_PROG@ -s "** $NOTIFICATIONTYPE$ alert - $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$ }# 'notify-by-epager' command definitiondefine command{ command_name notify-by-epager command_line /usr/bin/printf "%b" "Service: $SERVICEDESC$\nHost: $HOSTNAME$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\nInfo: $SERVICEOUTPUT$\nDate: $LONGDATETIME$" | @MAIL_PROG@ -s "$NOTIFICATIONTYPE$: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$" $CONTACTPAGER$ }################################################################################## SAMPLE PERFORMANCE DATA COMMANDS## These are sample performance data commands that can be used to send performance# data output to two text files (one for hosts, another for services). If you# plan on simply writing performance data out to a file, consider using the # host_perfdata_file and service_perfdata_file options in the main config file.################################################################################## 'process-host-perfdata' command definitiondefine command{ command_name process-host-perfdata command_line /usr/bin/printf "%b" "$LASTHOSTCHECK$\t$HOSTNAME$\t$HOSTSTATE$\t$HOSTATTEMPT$\t$HOSTSTATETYPE$\t$HOSTEXECUTIONTIME$\t$HOSTOUTPUT$\t$HOSTPERFDATA$\n" >> @localstatedir@/host-perfdata.out }# 'process-service-perfdata' command definitiondefine command{ command_name process-service-perfdata command_line /usr/bin/printf "%b" "$LASTSERVICECHECK$\t$HOSTNAME$\t$SERVICEDESC$\t$SERVICESTATE$\t$SERVICEATTEMPT$\t$SERVICESTATETYPE$\t$SERVICEEXECUTIONTIME$\t$SERVICELATENCY$\t$SERVICEOUTPUT$\t$SERVICEPERFDATA$\n" >> @localstatedir@/service-perfdata.out }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -