no longr build 31/sfapy2
[infrastructure.git] / nagios / AutomaticConfig / config-sample / commands-sample.cfg
1 ################################################################################
2 # Sample command definitions for Nagios 2.9
3 #
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!
7
8 # Last Modified: 11-21-2006
9 #
10 ################################################################################
11
12
13 ################################################################################
14 # COMMAND DEFINITIONS
15 #
16 # SYNTAX:
17 #
18 #       define command{
19 #               template      <templatename>
20 #               name          <objectname>
21 #               command_name  <commandname>
22 #               command_line  <commandline>
23 #               }
24 #
25 # WHERE:
26 #
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
33 #
34 ################################################################################
35
36
37
38
39 ################################################################################
40 #
41 # SAMPLE SERVICE CHECK COMMANDS
42 #
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.
46 #
47 ################################################################################
48
49
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 ################################################################################
54
55 # 'check_local_disk' command definition
56 define command{
57         command_name    check_local_disk
58         command_line    /usr/lib/nagios/plugins/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$
59         }
60
61
62 # 'check_local_load' command definition
63 define command{
64         command_name    check_local_load
65         command_line    /usr/lib/nagios/plugins/check_load -w $ARG1$ -c $ARG2$
66         }
67
68
69 # 'check_local_procs' command definition
70 define command{
71         command_name    check_local_procs
72         command_line    /usr/lib/nagios/plugins/check_procs -w $ARG1$ -c $ARG2$ -s $ARG3$
73         }
74
75
76 # 'check_local_users' command definition
77 define command{
78         command_name    check_local_users
79         command_line    /usr/lib/nagios/plugins/check_users -w $ARG1$ -c $ARG2$
80         }
81
82
83
84 ################################################################################
85 # NOTE:  The following 'check_...' commands are used to monitor services on
86 #        both local and remote hosts.
87 ################################################################################
88
89 # 'check_dns' command definition
90 define command{
91         command_name    check_dns
92         command_line    $USER1$/check_dns -H www.yahoo.com -s $HOSTADDRESS$
93         }
94
95
96 # 'check_ftp' command definition
97 define command{
98         command_name    check_ftp
99         command_line    $USER1$/check_ftp -H $HOSTADDRESS$
100         }
101
102
103 # 'check_hpjd' command definition
104 define command{
105         command_name    check_hpjd
106         command_line    $USER1$/check_hpjd -H $HOSTADDRESS$ -C public
107         }
108
109
110 # 'check_http' command definition
111 define command{
112         command_name    check_http
113         command_line    /usr/lib/nagios/plugins/check_http -H $HOSTADDRESS$
114         }
115
116
117 # 'check_nntp' command definition
118 define command{
119         command_name    check_nntp
120         command_line    $USER1$/check_nntp -H $HOSTADDRESS$
121         }
122
123
124 # 'check_ping' command definition
125 define command{
126         command_name    check_ping
127         command_line    $USER1$/check_ping -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p 5
128         }
129
130
131 # 'check_pop' command definition
132 define command{
133         command_name    check_pop
134         command_line    $USER1$/check_pop -H $HOSTADDRESS$
135         }
136
137
138 # 'check_smtp' command definition
139 define command{
140         command_name    check_smtp
141         command_line    $USER1$/check_smtp -H $HOSTADDRESS$
142         }
143
144
145 # 'check_tcp' command definition
146 define command{
147         command_name    check_tcp
148         command_line    $USER1$/check_tcp -H $HOSTADDRESS$ -p $ARG1$
149         }
150
151
152 # 'check_telnet' command definition
153 define command{
154         command_name    check_telnet
155         command_line    $USER1$/check_tcp -H $HOSTADDRESS$ -p 23
156         }
157
158
159 # 'check_udp' command definition
160 define command{
161         command_name    check_udp
162         command_line    $USER1$/check_udp -H $HOSTADDRESS$ -p $ARG1$
163         }
164
165 # 'check_ssh' command definition
166 define command{
167         command_name    check_ssh
168         command_line    /usr/lib/nagios/plugins//check_ssh -H $HOSTADDRESS$ 
169         }
170
171 # 'check_disk' command definition
172 define command{
173         command_name    check_remote_disk1
174         command_line    /usr/lib/nagios/plugins/check_nrpe -H $HOSTADDRESS$  -c check_disk1 
175         }
176
177 define command{
178         command_name    check_remote_disk2
179         command_line    /usr/lib/nagios/plugins/check_nrpe -H $HOSTADDRESS$  -c check_disk2 
180         }
181
182 define command{
183         command_name    check_remote_load
184         command_line    /usr/lib/nagios/plugins/check_nrpe -H $HOSTADDRESS$ -c check_load
185         }
186
187
188 define command{
189         command_name    check_remote_users
190         command_line    /usr/lib/nagios/plugins/check_nrpe -H $HOSTADDRESS$ -c check_users
191         }
192
193
194
195 define command{
196         command_name    check_remote_procs
197         command_line    /usr/lib/nagios/plugins/check_nrpe -H $HOSTADDRESS$ -c check_total_procs
198         }
199
200 ################################################################################
201 #
202 # SAMPLE HOST CHECK COMMANDS
203 #
204 ################################################################################
205
206
207 # This command checks to see if a host is "alive" by pinging it
208 # The check must result in a 100% packet loss or 5 second (5000ms) round trip 
209 # average time to produce a critical error.
210 # Note: Only one ICMP echo packet is sent (determined by the '-p 1' argument)
211
212 # 'check-host-alive' command definition
213 define command{
214         command_name    check-host-alive
215         command_line    /usr/lib/nagios/plugins/check_ping -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100% -p 1
216         }
217
218
219
220
221
222 ################################################################################
223 #
224 # SAMPLE NOTIFICATION COMMANDS
225 #
226 # These are some example notification commands.  They may or may not work on
227 # your system without modification.  As an example, some systems will require 
228 # you to use "/usr/bin/mailx" instead of "/usr/bin/mail" in the commands below.
229 #
230 ################################################################################
231
232
233 # 'host-notify-by-email' command definition
234 define command{
235         command_name    host-notify-by-email
236         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$
237         }
238
239
240 # 'host-notify-by-epager' command definition
241 define command{
242         command_name    host-notify-by-epager
243         command_line    /usr/bin/printf "%b" "Host '$HOSTALIAS$' is $HOSTSTATE$\nInfo: $HOSTOUTPUT$\nTime: $LONGDATETIME$" | /bin/mail -s "$NOTIFICATIONTYPE$ alert - Host $HOSTNAME$ is $HOSTSTATE$" $CONTACTPAGER$
244         }
245
246 # 'notify-by-email' command definition
247 define command{
248         command_name    notify-by-email
249         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$
250         }
251
252
253 # 'notify-by-epager' command definition
254 define command{
255         command_name    notify-by-epager
256         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$
257         }
258
259
260
261
262
263 ################################################################################
264 #
265 # SAMPLE PERFORMANCE DATA COMMANDS
266 #
267 # These are sample performance data commands that can be used to send performance
268 # data output to two text files (one for hosts, another for services).  If you
269 # plan on simply writing performance data out to a file, consider using the 
270 # host_perfdata_file and service_perfdata_file options in the main config file.
271 #
272 ################################################################################
273
274
275 # 'process-host-perfdata' command definition
276 define command{
277         command_name    process-host-perfdata
278         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
279         }
280
281
282 # 'process-service-perfdata' command definition
283 define command{
284         command_name    process-service-perfdata
285         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
286         }
287
288