/
commands.cfg
397 lines (331 loc) · 14.1 KB
/
commands.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
################################################################################
# commands.cfg - Main commands definition file
#===============================================================================
# This file show sample command definitions which are commonly used to monitor
# systems, websites, databases, etc.
#
# See also "pack/*/*/commands.cfg".
#
# You need the Nagios plugins installed under $PLUGINSDIR$ (see resource.cfg)
# in order to use most of these commands. For your own network you may need
# other plugins, which you can write yourself or find at Nagios Exchange.
#
# This file has three sections for easier reading:
# - Localhost_checks
# - Network_checks
# - Host_alive_checks
# - Notification_commands
# - Discovery_commands
# (You can use section names to jump there)
#===============================================================================
# Reference: http://www.shinken-monitoring.org/wiki/official/configuringshinken/configobjects/command
# Nagios Plugins: http://www.nagios.org/download/plugins/
# Nagios Exchange (Plugins repository): http://exchange.nagios.org/
################################################################################
################################################################################
# Localhost_checks
#===============================================================================
# Download:
# - Included in Nagios Plugins.
# - check_local_mem:
# https://github.com/justintime/nagios-plugins
################################################################################
## Check free space on local disks
# This plugin checks the amount of used disk space on a mounted file system and
# generates an alert if free space is less than one of the threshold values.
# check_disk -w limit -c limit [-W limit] [-K limit] {-p path | -x device} [-C]
# [-E] [-e] [-g group ] [-k] [-l] [-M] [-m] [-R path ] [-r path ] [-t timeout]
# [-u unit] [-v] [-X type]
define command {
command_name check_local_disks
command_line $PLUGINSDIR$/check_disk -w 10% -c 5% -x /dev/shm -e -l
}
## Check local load
# This plugin tests the current system load average.
# check_load [-r] -w WLOAD1,WLOAD5,WLOAD15 -c CLOAD1,CLOAD5,CLOAD15
define command {
command_name check_local_load
command_line $PLUGINSDIR$/check_load -w 3,3,3 -c 5,5,5
}
## Check used memory
# check_mem.pl -<f|u> -w <warnlevel> -c <critlevel>
define command {
command_name check_local_mem
command_line $PLUGINSDIR$/check_mem.pl -u -w 90 -c 95
}
## Check swap space on local machine.
# check_swap [-av] -w <percent_free>% -c <percent_free>%
# check_swap [-av] -w <bytes_free> -c <bytes_free>
define command {
command_name check_local_swap
command_line $PLUGINSDIR$/check_swap -w 50% -c 25%
}
################################################################################
# Network_checks
#===============================================================================
# Download:
# - Included in Nagios Plugins.
# - check_nrpe:
# http://exchange.nagios.org/directory/Addons/Monitoring-Agents/NRPE--2D-Nagios-Remote-Plugin-Executor/details
# - check_snmp_*:
# ???
################################################################################
## Check a TCP port
# This plugin tests TCP connections with the specified host (or unix socket).
# check_tcp -H host -p port [-w <warning time>] [-c <critical time>] [-s <send
# string>] [-e <expect string>] [-q <quit string>][-m <maximum bytes>] [-d
# <delay>] [-t <timeout seconds>] [-r <refuse state>] [-M <mismatch state>]
# [-v] [-4|-6] [-j] [-D <warn days cert expire>[,<crit days cert expire>]] [-S
# <use SSL>] [-E]
define command {
command_name check_tcp
command_line $PLUGINSDIR$/check_tcp -H $HOSTADDRESS$ -p $ARG1$
}
## Check a DNS entry
## This plugin test the DNS service on the specified host using dig
# check_dig -l <query_address> [-H <host>] [-p <server port>] [-T <query type>]
# [-w <warning interval>] [-c <critical interval>] [-t <timeout>] [-a <expected
# answer address>] [-v]
define command {
command_name check_dig
command_line $PLUGINSDIR$/check_dig -H $HOSTADDRESS$ -l $ARG1$
}
## Check ping command
## Use ping to check connection statistics for a remote host.
# check_ping -H <host_address> -w <wrta>,<wpl>% -c <crta>,<cpl>% [-p packets]
# [-t timeout] [-4|-6]
define command {
command_name check_ping
command_line $PLUGINSDIR$/check_ping -H $HOSTADDRESS$ -w 3000,100% -c 5000,100% -p 1
}
## Check Oracle status
# check_oracle --tns <Oracle Sid or Hostname/IP address>
# check_oracle --db <ORACLE_SID>
# etc. (see plugin's help)
define command {
command_name check_oracle_listener
command_line $PLUGINSDIR$/check_oracle --tns $HOSTADDRESS$
}
## Ask a NRPE agent
## Requires that you have the NRPE daemon running on the remote host.
# check_nrpe -H <host> [-n] [-u] [-p <port>] [-t <timeout>] [-c <command>] [-a
# <arglist...>]
define command {
command_name check_nrpe
command_line $PLUGINSDIR$/check_nrpe -H $HOSTADDRESS$ -t 9 -u -c $ARG1$
#module_type nrpe_poller
}
## Ask a NRPE agent with arguments (passing arguments may be a security risk)
## Requires that you have the NRPE daemon running on the remote host.
# check_nrpe -H <host> [-n] [-u] [-p <port>] [-t <timeout>] [-c <command>] [-a
# <arglist...>]
define command {
command_name check_nrpe_args
command_line $PLUGINSDIR$/check_nrpe -H $HOSTADDRESS$ -t 9 -u -c $ARG1$ -a $ARG2$ $ARG3$ $ARG4$ $ARG5$
#module_type nrpe_poller
}
# Check SNMP service presence on target
define command {
command_name check_snmp_service
command_line $PLUGINSDIR$/check_snmp_service -H $HOSTADDRESS$ -C $SNMPCOMMUNITYREAD$
}
# Compare time between target and shinken
define command {
command_name check_snmp_time
command_line $PLUGINSDIR$/check_snmp_time.pl -H $HOSTADDRESS$ -C $SNMPCOMMUNITYREAD$ -f -w $ARG1$ -c $ARG2$
}
# Check filesystem usage over SNMP
define command {
command_name check_snmp_storage
command_line $PLUGINSDIR$/check_snmp_storage.pl -H $HOSTADDRESS$ -C $SNMPCOMMUNITYREAD$ -T pl -f -m $ARG1$ -w $ARG2$ -c $ARG3$
}
# Same but special OID for HPUX
define command {
command_name check_snmp_hpux_storage
command_line $PLUGINSDIR$/check_snmp_hpux_storage.pl -H $HOSTADDRESS$ -C $SNMPCOMMUNITYREAD$ -T pl -f -m $ARG1$ -w $ARG2$ -c $ARG3$
}
################################################################################
# application performance monitoring checks (end user experience)
#===============================================================================
# Download:
# - Included in shinken.
# This check is in alpha release and should be enabled with the following
# installer command : ./install --enableeue
# This is based on cucumber (see http://cukes.info)
################################################################################
define command {
command_name check_eue
command_line /usr/bin/cucumber --format Eue::Shinken $PLUGINSDIR$/eue/$ARG1$.feature
timeout 60
}
################################################################################
# Host_alive_checks
################################################################################
define command {
command_name check_host_alive
command_line $PLUGINSDIR$/check_ping -H $HOSTADDRESS$ -w 1,50% -c 2,70% -p 1
#poller_tag DMZ
#module_type nrpe_poller
}
define command {
command_name check_linux_host_alive
command_line $PLUGINSDIR$/check_tcp -H $HOSTADDRESS$ -p 22 -t 3
#poller_tag DMZ
#module_type nrpe_poller
}
define command {
command_name check_windows_host_alive
command_line $PLUGINSDIR$/check_tcp -H $HOSTADDRESS$ -p 139 -t 3
#poller_tag DMZ
#module_type nrpe_poller
}
################################################################################
# Commands you probably don't need.
# TODO: Remove them, no?
################################################################################
define command {
command_name check-host-alive
command_line $PLUGINSDIR$/check.sh $HOSTADDRESS$ -c $ARG1$ HOST $_HOSTDELLSUCK$ $SERVICEDESC:srv-1:Service-2$ $SERVICEDESC::Service-30$ $HOSTADDRESS:$ $HOSTGROUPALIAS:linux-servers$
#module_type dummy_poller
}
define command {
command_name check_local_disk
command_line $PLUGINSDIR$/check.sh $HOSTADDRESS$ -c $ARG1$ SERVICE $USER1$
#poller_tag DMZ
#module_type nrpe_poller
}
# Dummy check port command
define command {
command_name check_port
command_line /bin/ping localhost -c 1
#command_line $PLUGINSDIR$/check.sh $HOSTADDRESS$ -c $ARG1$
#poller_tag DMZ
#module_type nrpe_poller
}
# Dummy check for mysql, always CRITICAL
define command {
command_name check_mysql
command_line $PLUGINSDIR$/check_dummy.sh 2
}
define command {
command_name check_dummy
command_line $PLUGINSDIR$/check_dummy.sh $ARG1$
#poller_tag DMZ
}
define command {
command_name check_utf8
command_line $PLUGINSDIR$/check_utf8.sh
}
define command {
command_name super_event_kill_everyone
command_line $PLUGINSDIR$/check.sh $HOSTADDRESS$ -c $ARG1$ SERVICE $_HOSTDELLSUCK$
}
# We say Http checks are always OK
define command {
command_name check_http2
command_line $PLUGINSDIR$/check_dummy.sh 1
#module_type nrpe_poller
}
define command {
command_name check_vm_cpu
command_line $PLUGINSDIR$/check_esx3.pl -H lulu
}
################################################################################
# Notification_commands
#===============================================================================
# Download:
# - notify-*-by-email:
# Use 'printf' and 'mail' system tools. (you may need to update their
# paths, ie. "/bin/mail" instead of "/usr/bin/mail").
# - notify-*-by-xmpp:
# The Python script is in the libexec folder of the Shinken's sources.
# It need the Python XMPP module.
# On supported distributions, this addon can be installed and configured by
# ./install -a notify_by_xmpp
# - notify-*-by-android-sms:
# Use Shinken reactionner (see shinken-specific.cfg).
################################################################################
## Notify Host by Email
define command {
command_name notify-host-by-email
command_line /usr/bin/printf "%b" "Shinken Notification\n\nType:$NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\nDate/Time: $DATE$\n" | /usr/bin/mail -s "Host $HOSTSTATE$ alert for $HOSTNAME$!" $CONTACTEMAIL$
}
## Notify Service by Email
define command {
command_name notify-service-by-email
command_line /usr/bin/printf "%b" "Shinken Notification\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $DATE$ Additional Info : $SERVICEOUTPUT$\n" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$ alert - $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
}
## Notify Host by XMPP
define command {
command_name notify-host-by-xmpp
command_line $PLUGINSDIR$/notify_by_xmpp.py -a $PLUGINSDIR$/notify_by_xmpp.ini "Host '$HOSTNAME$' is $HOSTSTATE$ - Info : $HOSTOUTPUT$" $CONTACTEMAIL$
}
## Notify Service by XMPP
define command {
command_name notify-service-by-xmpp
command_line $PLUGINSDIR$/notify_by_xmpp.py -a $PLUGINSDIR$/notify_by_xmpp.ini "$NOTIFICATIONTYPE$ $HOSTNAME$ $SERVICEDESC$ $SERVICESTATE$ $SERVICEOUTPUT$ $LONGDATETIME$" $CONTACTEMAIL$
}
## Notify Host by SMS (through an Android phone)
# You need both reactionner_tag and module_type in most cases!
define command {
command_name notify-host-by-android-sms
command_line android_sms $CONTACTPAGER$ Host: $HOSTNAME$\nAddress: $HOSTADDRESS$\nState: $HOSTSTATE$\nInfo: $OUTPUT$\nDate: $DATETIME$
reactionner_tag android_sms
module_type android_sms
}
## Notify Service by SMS (through an Android phone)
# You need both reactionner_tag and module_type in most cases!
define command {
command_name notify-service-by-android-sms
command_line android_sms $CONTACTPAGER$ Service: $SERVICEDESC$\nHost: $HOSTNAME$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\nInfo: $OUTPUT$\nDate: $DATETIME$
reactionner_tag android_sms
module_type android_sms
}
################################################################################
# Skonf related commands
#===============================================================================
define command {
command_name restart_shinken
command_line sudo /etc/init.d/shinken restart
}
define command {
command_name reload_shinken
command_line sudo /etc/init.d/shinken reload
}
define command {
command_name configuration_check
command_line sudo /etc/init.d/shinken check
}
################################################################################
# Discovery_commands
#===============================================================================
# Download:
# - nmap_discovery, vmware_esx_discovery:
# Shinken's sources (in libexec)
# - fs_discovery, cluster_discovery:
# ???
################################################################################
## NMAP Discovery
# nmap_discovery_runner.py [options] -t nmap scanning targets
define command {
command_name nmap_discovery
command_line $PLUGINSDIR$/nmap_discovery_runner.py --min-rate $NMAPMINRATE$ --max-retries $NMAPMAXRETRIES$ -t $NMAPTARGETS$
}
## VMWare ESX Discovery
# vmware_discovery_runner.py [options]
define command {
command_name vmware_esx_discovery
command_line $PLUGINSDIR$/vmware_discovery_runner.py -V $VCENTER$ -u $VCENTERLOGIN$ -p $VCENTERPASSWORD$ -r "lower|nofqdn"
}
##
#
define command {
command_name fs_discovery
command_line $PLUGINSDIR$/fs_discovery_runner.py -H $HOSTNAME$ -C $SNMPCOMMUNITYREAD$ -O $ARG1$ -m tags
}
##
#
define command {
command_name cluster_discovery
command_line $PLUGINSDIR$/cluster_discovery_runner.py -H $HOSTNAME$ -C $SNMPCOMMUNITYREAD$ -O $ARG1$
}