source: nagios/objects/commands.cfg@ 235

Last change on this file since 235 was 202, checked in by Rick van der Zwet, 14 years ago

Nagios config files

File size: 8.2 KB
Line 
1###############################################################################
2# COMMANDS.CFG - SAMPLE COMMAND DEFINITIONS FOR NAGIOS 3.2.2
3#
4# Last Modified: 05-31-2007
5#
6# NOTES: This config file provides you with some example command definitions
7# that you can reference in host, service, and contact definitions.
8#
9# You don't need to keep commands in a separate file from your other
10# object definitions. This has been done just to make things easier to
11# understand.
12#
13###############################################################################
14
15
16################################################################################
17#
18# SAMPLE NOTIFICATION COMMANDS
19#
20# These are some example notification commands. They may or may not work on
21# your system without modification. As an example, some systems will require
22# you to use "/usr/bin/mailx" instead of "/usr/bin/mail" in the commands below.
23#
24################################################################################
25
26
27# 'notify-host-by-email' command definition
28define command{
29 command_name notify-host-by-email
30 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$
31 }
32
33# 'notify-service-by-email' command definition
34define command{
35 command_name notify-service-by-email
36 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$
37 }
38
39
40
41
42
43################################################################################
44#
45# SAMPLE HOST CHECK COMMANDS
46#
47################################################################################
48
49
50# This command checks to see if a host is "alive" by pinging it
51# The check must result in a 100% packet loss or 5 second (5000ms) round trip
52# average time to produce a critical error.
53# Note: Five ICMP echo packets are sent (determined by the '-p 5' argument)
54
55# 'check-host-alive' command definition
56define command{
57 command_name check-host-alive
58 command_line $USER1$/check_ping -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100% -p 10
59 }
60
61
62
63
64################################################################################
65#
66# SAMPLE SERVICE CHECK COMMANDS
67#
68# These are some example service check commands. They may or may not work on
69# your system, as they must be modified for your plugins. See the HTML
70# documentation on the plugins for examples of how to configure command definitions.
71#
72# NOTE: The following 'check_local_...' functions are designed to monitor
73# various metrics on the host that Nagios is running on (i.e. this one).
74################################################################################
75
76# 'check_local_disk' command definition
77define command{
78 command_name check_local_disk
79 command_line $USER1$/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$
80 }
81
82
83# 'check_local_load' command definition
84define command{
85 command_name check_local_load
86 command_line $USER1$/check_load -w $ARG1$ -c $ARG2$
87 }
88
89
90# 'check_local_procs' command definition
91define command{
92 command_name check_local_procs
93 command_line $USER1$/check_procs -w $ARG1$ -c $ARG2$ -s $ARG3$
94 }
95
96
97# 'check_local_users' command definition
98define command{
99 command_name check_local_users
100 command_line $USER1$/check_users -w $ARG1$ -c $ARG2$
101 }
102
103
104# 'check_local_swap' command definition
105define command{
106 command_name check_local_swap
107 command_line $USER1$/check_swap -w $ARG1$ -c $ARG2$
108 }
109
110
111# 'check_local_mrtgtraf' command definition
112define command{
113 command_name check_local_mrtgtraf
114 command_line $USER1$/check_mrtgtraf -F $ARG1$ -a $ARG2$ -w $ARG3$ -c $ARG4$ -e $ARG5$
115 }
116
117
118################################################################################
119# NOTE: The following 'check_...' commands are used to monitor services on
120# both local and remote hosts.
121################################################################################
122
123# 'check_ftp' command definition
124define command{
125 command_name check_ftp
126 command_line $USER1$/check_ftp -H $HOSTADDRESS$ $ARG1$
127 }
128
129
130# 'check_hpjd' command definition
131define command{
132 command_name check_hpjd
133 command_line $USER1$/check_hpjd -H $HOSTADDRESS$ $ARG1$
134 }
135
136
137# 'check_snmp' command definition
138define command{
139 command_name check_snmp
140 command_line $USER1$/check_snmp -H $HOSTADDRESS$ $ARG1$
141 }
142
143
144# 'check_http' command definition
145define command{
146 command_name check_http
147 command_line $USER1$/check_http -H $HOSTNAME$ -I $HOSTADDRESS$ $ARG1$
148 }
149
150# 'check_dns' command definition
151define command{
152 command_name check_dns
153 command_line $USER1$/check_dns -A -H $HOSTNAME$ -s $HOSTADDRESS$ $ARG1$
154 }
155
156
157# 'check_ssh' command definition
158define command{
159 command_name check_ssh
160 command_line $USER1$/check_ssh $ARG1$ $HOSTADDRESS$
161 }
162
163
164# 'check_dhcp' command definition
165define command{
166 command_name check_dhcp
167 command_line $USER1$/check_dhcp $ARG1$
168 }
169
170
171# 'check_ping' command definition
172define command{
173 command_name check_ping
174 command_line $USER1$/check_ping -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p 5
175 }
176
177
178# 'check_pop' command definition
179define command{
180 command_name check_pop
181 command_line $USER1$/check_pop -H $HOSTADDRESS$ $ARG1$
182 }
183
184
185# 'check_imap' command definition
186define command{
187 command_name check_imap
188 command_line $USER1$/check_imap -H $HOSTADDRESS$ $ARG1$
189 }
190
191
192# 'check_smtp' command definition
193define command{
194 command_name check_smtp
195 command_line $USER1$/check_smtp -H $HOSTADDRESS$ $ARG1$
196 }
197
198
199# 'check_tcp' command definition
200define command{
201 command_name check_tcp
202 command_line $USER1$/check_tcp -H $HOSTADDRESS$ -p $ARG1$ $ARG2$
203 }
204
205
206# 'check_udp' command definition
207define command{
208 command_name check_udp
209 command_line $USER1$/check_udp -H $HOSTADDRESS$ -p $ARG1$ $ARG2$
210 }
211
212
213# 'check_nt' command definition
214define command{
215 command_name check_nt
216 command_line $USER1$/check_nt -H $HOSTADDRESS$ -p 12489 -v $ARG1$ $ARG2$
217 }
218
219define command {
220 command_name check_snmp_int
221 command_line $USER1$/check_snmp_int.pl -H $HOSTADDRESS$ -C 'public!' -2 -f -n $ARG1$
222}
223
224
225
226################################################################################
227#
228# SAMPLE PERFORMANCE DATA COMMANDS
229#
230# These are sample performance data commands that can be used to send performance
231# data output to two text files (one for hosts, another for services). If you
232# plan on simply writing performance data out to a file, consider using the
233# host_perfdata_file and service_perfdata_file options in the main config file.
234#
235################################################################################
236
237
238# # 'process-host-perfdata' command definition
239# define command{
240# command_name process-host-perfdata
241# command_line /usr/bin/printf "%b" "$LASTHOSTCHECK$\t$HOSTNAME$\t$HOSTSTATE$\t$HOSTATTEMPT$\t$HOSTSTATETYPE$\t$HOSTEXECUTIONTIME$\t$HOSTOUTPUT$\t$HOSTPERFDATA$\n" >> /var/spool/nagios/host-perfdata.out
242# }
243#
244#
245# # 'process-service-perfdata' command definition
246# define command{
247# command_name process-service-perfdata
248# 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/spool/nagios/service-perfdata.out
249# }
250
251define command{
252 command_name process-service-perfdata-file
253 command_line /usr/local/libexec/process_perfdata.pl --bulk=/var/spool/nagios/service-perfdata
254 }
255
256define command{
257 command_name process-host-perfdata-file
258 command_line /usr/local/libexec/process_perfdata.pl --bulk=/var/spool/nagios/host-perfdata
259 }
260
261
262
Note: See TracBrowser for help on using the repository browser.