############################################################################### # COMMANDS.CFG - COMMAND DEFINITIONS FOR NAGIOS # # Last Modified: # ############################################################################### # # HOST CHECK COMMANDS # ################################################################################ # 'check-host-alive' command definition # 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: Five ICMP echo packets are sent (determined by the '-p 5' argument) # ipv4 is used (the -4 argument) define command{ command_name check-host-alive command_line $USER1$/check_ping -H $HOSTADDRESS$ -w 3000,80% -c 5000,100% -p 5 -4 } # 'check_inet_alive' command definition # parses output /tmp/networkstatus of the /tools/check-inet-alive script on the nodes define command{ command_name check_inet_alive command_line $USER1$/v2/check_inet_alive $HOSTADDRESS$ } # 'check_http' command definition define command{ command_name check_http command_line $USER1$/check_http -I $HOSTADDRESS$ -t 20 } # 'check_uptime' command definition define command{ command_name check_uptime command_line $USER1$/v2/check_uptime.pl -H $HOSTADDRESS$ -C public } define command{ command_name check_disk_snmp command_line $USER1$/v2/check_disk_snmp.pl -H $HOSTADDRESS$ -d $ARG1$ } # dns define command{ command_name check_dns_wl command_line $USER1$/v2/check_dns_wl $HOSTADDRESS$ $ARG1$ } # 'check_ssh' command definition define command{ command_name check_ssh command_line $USER1$/check_ssh -t 20 $HOSTADDRESS$ } # 'check_ping' command definition define command{ command_name check_ping command_line $USER1$/check_ping -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p 5 } ################################################################################ # # LOCAL CHECK COMMANDS # # 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 definition define command{ command_name check_local_disk command_line $USER1$/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$ } # 'check_local_load' command definition define command{ command_name check_local_load command_line $USER1$/check_load -w $ARG1$ -c $ARG2$ } # 'check_local_procs' command definition define command{ command_name check_local_procs command_line $USER1$/check_procs -w $ARG1$ -c $ARG2$ -s $ARG3$ } # 'check_local_users' command definition define command{ command_name check_local_users command_line $USER1$/check_users -w $ARG1$ -c $ARG2$ } # 'check_local_swap' command definition define command{ command_name check_local_swap command_line $USER1$/check_swap -w $ARG1$ -c $ARG2$ } # 'check_local_mrtgtraf' command definition define command{ command_name check_local_mrtgtraf command_line $USER1$/check_mrtgtraf -F $ARG1$ -a $ARG2$ -w $ARG3$ -c $ARG4$ -e $ARG5$ } ################################################################################ # # 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. # ################################################################################ # 'notify-host-by-email' command definition define command{ command_name notify-host-by-email command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$ } # 'notify-service-by-email' command definition define command{ command_name notify-service-by-email command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$\n" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$ } ###############################################################################