1 ################################################################################
2 # Sample command definitions for Nagios 2.9
4 # Read the documentation for more information on this configuration file. I've
5 # provided some comments here, but things may not be so clear without further
6 # explanation, so make sure to read the HTML documentation!
8 # Last Modified: 11-21-2006
10 ################################################################################
13 ################################################################################
19 # template <templatename>
21 # command_name <commandname>
22 # command_line <commandline>
27 # <templatename> = object name of another command definition that should be
28 # used as a template for this definition (optional)
29 # <objectname> = object name of command definition, referenced by other
30 # command definitions that use it as a template (optional)
31 # <commandname> = name of the command, as recognized/used by Nagios
32 # <commandline> = command line
34 ################################################################################
39 ################################################################################
41 # SAMPLE SERVICE CHECK COMMANDS
43 # These are some example service check commands. They may or may not work on
44 # your system, as they must be modified for your plugins. See the HTML
45 # documentation on the plugins for examples of how to configure command definitions.
47 ################################################################################
50 ################################################################################
51 # NOTE: The following 'check_local_...' functions are designed to monitor
52 # various metrics on the host that Nagios is running on (i.e. this one).
53 ################################################################################
55 # 'check_local_disk' command definition
57 command_name check_local_disk
58 command_line $USER1$/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$
62 # 'check_local_load' command definition
64 command_name check_local_load
65 command_line $USER1$/check_load -w $ARG1$ -c $ARG2$
69 # 'check_local_procs' command definition
71 command_name check_local_procs
72 command_line $USER1$/check_procs -w $ARG1$ -c $ARG2$ -s $ARG3$
76 # 'check_local_users' command definition
78 command_name check_local_users
79 command_line $USER1$/check_users -w $ARG1$ -c $ARG2$
84 ################################################################################
85 # NOTE: The following 'check_...' commands are used to monitor services on
86 # both local and remote hosts.
87 ################################################################################
89 # 'check_dns' command definition
91 command_name check_dns
92 command_line $USER1$/check_dns -H www.yahoo.com -s $HOSTADDRESS$
96 # 'check_ftp' command definition
98 command_name check_ftp
99 command_line $USER1$/check_ftp -H $HOSTADDRESS$
103 # 'check_hpjd' command definition
105 command_name check_hpjd
106 command_line $USER1$/check_hpjd -H $HOSTADDRESS$ -C public
110 # 'check_http' command definition
112 command_name check_http
113 command_line $USER1$/check_http -H $HOSTADDRESS$
117 # 'check_nntp' command definition
119 command_name check_nntp
120 command_line $USER1$/check_nntp -H $HOSTADDRESS$
124 # 'check_ping' command definition
126 command_name check_ping
127 command_line $USER1$/check_ping -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p 5
131 # 'check_pop' command definition
133 command_name check_pop
134 command_line $USER1$/check_pop -H $HOSTADDRESS$
138 # 'check_smtp' command definition
140 command_name check_smtp
141 command_line $USER1$/check_smtp -H $HOSTADDRESS$
145 # 'check_tcp' command definition
147 command_name check_tcp
148 command_line $USER1$/check_tcp -H $HOSTADDRESS$ -p $ARG1$
152 # 'check_telnet' command definition
154 command_name check_telnet
155 command_line $USER1$/check_tcp -H $HOSTADDRESS$ -p 23
159 # 'check_udp' command definition
161 command_name check_udp
162 command_line $USER1$/check_udp -H $HOSTADDRESS$ -p $ARG1$
168 ################################################################################
170 # SAMPLE HOST CHECK COMMANDS
172 ################################################################################
175 # This command checks to see if a host is "alive" by pinging it
176 # The check must result in a 100% packet loss or 5 second (5000ms) round trip
177 # average time to produce a critical error.
178 # Note: Only one ICMP echo packet is sent (determined by the '-p 1' argument)
180 # 'check-host-alive' command definition
182 command_name check-host-alive
183 command_line $USER1$/check_ping -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100% -p 1
189 ################################################################################
191 # SAMPLE NOTIFICATION COMMANDS
193 # These are some example notification commands. They may or may not work on
194 # your system without modification. As an example, some systems will require
195 # you to use "/usr/bin/mailx" instead of "/usr/bin/mail" in the commands below.
197 ################################################################################
200 # 'host-notify-by-email' command definition
202 command_name host-notify-by-email
203 command_line /usr/bin/printf "%b" "***** Nagios 2.9 *****\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$
207 # 'host-notify-by-epager' command definition
209 command_name host-notify-by-epager
210 command_line /usr/bin/printf "%b" "Host '$HOSTALIAS$' is $HOSTSTATE$\nInfo: $HOSTOUTPUT$\nTime: $LONGDATETIME$" | /bin/mail -s "$NOTIFICATIONTYPE$ alert - Host $HOSTNAME$ is $HOSTSTATE$" $CONTACTPAGER$
213 # 'notify-by-email' command definition
215 command_name notify-by-email
216 command_line /usr/bin/printf "%b" "***** Nagios 2.9 *****\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$
220 # 'notify-by-epager' command definition
222 command_name notify-by-epager
223 command_line /usr/bin/printf "%b" "Service: $SERVICEDESC$\nHost: $HOSTNAME$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\nInfo: $SERVICEOUTPUT$\nDate: $LONGDATETIME$" | /bin/mail -s "$NOTIFICATIONTYPE$: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$" $CONTACTPAGER$
230 ################################################################################
232 # SAMPLE PERFORMANCE DATA COMMANDS
234 # These are sample performance data commands that can be used to send performance
235 # data output to two text files (one for hosts, another for services). If you
236 # plan on simply writing performance data out to a file, consider using the
237 # host_perfdata_file and service_perfdata_file options in the main config file.
239 ################################################################################
242 # 'process-host-perfdata' command definition
244 command_name process-host-perfdata
245 command_line /usr/bin/printf "%b" "$LASTHOSTCHECK$\t$HOSTNAME$\t$HOSTSTATE$\t$HOSTATTEMPT$\t$HOSTSTATETYPE$\t$HOSTEXECUTIONTIME$\t$HOSTOUTPUT$\t$HOSTPERFDATA$\n" >> /var/log/nagios/host-perfdata.out
249 # 'process-service-perfdata' command definition
251 command_name process-service-perfdata
252 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" >> /var/log/nagios/service-perfdata.out