1 ################################################################################
2 # Object config file for Nagios
4 ################################################################################
7 ################################################################################
13 # template <templatename>
15 # command_name <commandname>
16 # command_line <commandline>
21 # <templatename> = object name of another command definition that should be
22 # used as a template for this definition (optional)
23 # <objectname> = object name of command definition, referenced by other
24 # command definitions that use it as a template (optional)
25 # <commandname> = name of the command, as recognized/used by Nagios
26 # <commandline> = command line
28 ################################################################################
33 ################################################################################
35 # NOTIFICATION COMMANDS
37 # This is a sample service notification command that can be used to send email
38 # notifications (about service alerts) to contacts.
40 ################################################################################
43 # This is a sample service notification command that can be used to send email
44 # notifications (about service alerts) to contacts.
46 command_name notify-by-email
47 command_line /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$" | /bin/mail -s "** $NOTIFICATIONTYPE$ alert - $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
50 # 'notify-by-epager' command definition
52 command_name notify-by-epager
53 command_line /bin/printf "%b" "Service: $SERVICEDESC$\nHost: $HOSTNAME$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\nInfo: $SERVICEOUTPUT$\nDate: $LONGDATETIME$" | /bin/mail -s "$NOTIFICATIONTYPE$: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$" $CONTACTPAGER$
56 # This is a sample host notification command that can be used to send email
57 # notifications (about host alerts) to contacts.
59 command_name host-notify-by-email
60 command_line /bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /bin/mail -s "Host $HOSTSTATE$ alert for $HOSTNAME$!" $CONTACTEMAIL$
63 # 'host-notify-by-epager' command definition
65 command_name host-notify-by-epager
66 command_line /bin/printf "%b" "Host '$HOSTALIAS$' is $HOSTSTATE$\nInfo: $HOSTOUTPUT$\nTime: $LONGDATETIME$" | /bin/mail -s "$NOTIFICATIONTYPE$ alert - Host $HOSTNAME$ is $HOSTSTATE$" $CONTACTPAGER$
69 ################################################################################
71 # PERFORMANCE DATA COMMANDS
73 # These are sample performance data commands that can be used to send performance
74 # data output to two text files (one for hosts, another for services). If you
75 # plan on simply writing performance data out to a file, consider compiling
76 # Nagios with native file support for performance data. This is done by
77 # supplying the --with-file-perfdata option to the configure script.
79 ################################################################################
81 # 'process-host-perfdata' command definition
83 command_name process-host-perfdata
84 command_line /bin/printf "%b" "$LASTHOSTCHECK$\t$HOSTNAME$\t$HOSTSTATE$\t$HOSTATTEMPT$\t$HOSTSTATETYPE$\t$HOSTEXECUTIONTIME$\t$HOSTOUTPUT$\t$HOSTPERFDATA$" >> /var/lib/nagios/host-perfdata.out
87 # 'process-service-perfdata' command definition
89 command_name process-service-perfdata
90 command_line /bin/printf "%b" "$LASTSERVICECHECK$\t$HOSTNAME$\t$SERVICEDESC$\t$SERVICESTATE$\t$SERVICEATTEMPT$\t$SERVICESTATETYPE$\t$SERVICEEXECUTIONTIME$\t$SERVICELATENCY$\t$SERVICEOUTPUT$\t$SERVICEPERFDATA$" >> /var/lib/nagios/service-perfdata.out