This file is indexed.

/etc/icinga/objects/check_mk/check_mk_templates.cfg is in check-mk-config-icinga 1.2.8p16-1ubuntu0.1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
# +------------------------------------------------------------------+
# |             ____ _               _        __  __ _  __           |
# |            / ___| |__   ___  ___| | __   |  \/  | |/ /           |
# |           | |   | '_ \ / _ \/ __| |/ /   | |\/| | ' /            |
# |           | |___| | | |  __/ (__|   <    | |  | | . \            |
# |            \____|_| |_|\___|\___|_|\_\___|_|  |_|_|\_\           |
# |                                                                  |
# | Copyright Mathias Kettner 2014             mk@mathias-kettner.de |
# +------------------------------------------------------------------+
#
# This file is part of Check_MK.
# The official homepage is at http://mathias-kettner.de/check_mk.
#
# check_mk is free software;  you can redistribute it and/or modify it
# under the  terms of the  GNU General Public License  as published by
# the Free Software Foundation in version 2.  check_mk is  distributed
# in the hope that it will be useful, but WITHOUT ANY WARRANTY;  with-
# out even the implied warranty of  MERCHANTABILITY  or  FITNESS FOR A
# PARTICULAR PURPOSE. See the  GNU General Public License for more de-
# tails. You should have  received  a copy of the  GNU  General Public
# License along with GNU Make; see the file  COPYING.  If  not,  write
# to the Free Software Foundation, Inc., 51 Franklin St,  Fifth Floor,
# Boston, MA 02110-1301 USA.

# These file contains templates for monitoring objects. The
# configuration that Check_MK creates uses these templates.
# You *can* modify this file, but if you want to change parameters
# for hosts and services a better idea is using extra_host_conf
# and extra_service_conf.
#
# OMD users: your modifications to this file are handled
# by 'omd update' so no problems should arise during an
# update as long as your modifications to not collide
# with modifications due to new versions of the file. OMD
# will let you interactively resolve such a conflict.
#
# Non-OMD users: Usually this file is created as a symlink
# in nagios/etc/conf.d  (or objects or whatever directory
# you are using) pointing to the shipped file. If you want
# to modify this file, then replace the symlink with a true
# copy of the file. Note, however, that a software update
# of Check_MK will not update your check_mk_templates.cfg
# anymore and you might get incompatible as time goes by.

# ------------------------------------------------------------------

#       ____            _             _
#      / ___|___  _ __ | |_ __ _  ___| |_ ___
#     | |   / _ \| '_ \| __/ _` |/ __| __/ __|
#     | |__| (_) | | | | || (_| | (__| |_\__ \
#      \____\___/|_| |_|\__\__,_|\___|\__|___/
#

# This contact is only needed while you have not configured contacts
# for your hosts and services with the variables
# service_contactgroups and host_contactgroups. This is, because
# Nagios does not allow a host or service to not have a contact.
# And we want this default configuration file to be complete
# and work.

define contact {
  contact_name 			  check_mk
  alias 			  check_mk dummy contact
  host_notification_commands 	  check-mk-dummy
  service_notification_commands	  check-mk-dummy
  host_notification_options       n
  service_notification_options    n
  host_notification_period        24X7
  service_notification_period     24X7
}

define contactgroup {
  contactgroup_name		  check_mk
  alias				  check_mk dummy contact group
  members			  check_mk
}


#      _   _           _
#     | | | | ___  ___| |_ ___
#     | |_| |/ _ \/ __| __/ __|
#     |  _  | (_) \__ \ |_\__ \
#     |_| |_|\___/|___/\__|___/
#

# Base template for all hosts that are monitored
# with check_mk
define host {
  name				  check_mk_default
  register                        0
  notifications_enabled           1
  event_handler_enabled           0
  flap_detection_enabled          1
  failure_prediction_enabled      1
  retain_status_information       1
  retain_nonstatus_information    1
  process_perf_data	          0
  check_command                   check-mk-host-ping
  check_interval                  1
  check_period                    24X7
  max_check_attempts              1
  notification_interval           0
  notification_period             24X7
  notification_options            d,u,r,f,s
  contact_groups                  check_mk
}


# This template is used for normal hosts
define host {
  name				  check_mk_host
  use				  check_mk_default
  register			  0
  process_perf_data               1
  action_url			  /pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=_HOST_' class='tips' rel='/pnp4nagios/index.php/popup?host=$HOSTNAME$&srv=_HOST_
}


# If you use service aggregation than this template
# is used for your summary hosts. The notes url
# links to the detailed host belonging to this summary
# host. You might need to adopt the URL.
define host {
  name				  check_mk_host-summary
  use				  check_mk_default
  register			  0
  notes_url                       /nagios/cgi-bin//status.cgi?host=$_HOST_REALNAME$
}


# Used for cluster hosts (i.e. the logical hosts, not
# the cluster's nodes)
define host {
  name				  check_mk_cluster
  use				  check_mk_default
  check_command                   check-mk-host-ping-cluster
  register			  0
}


# Used for aggregation host of clusters.
define host {
  name				  check_mk_cluster-summary
  use				  check_mk_cluster,check_mk_host-summary
  register			  0
}


#      ____                  _
#     / ___|  ___ _ ____   _(_) ___ ___  ___
#     \___ \ / _ \ '__\ \ / / |/ __/ _ \/ __|
#      ___) |  __/ |   \ V /| | (_|  __/\__ \
#     |____/ \___|_|    \_/ |_|\___\___||___/
#

# Template used by all other check_mk templates
define service {
  name	                          check_mk_default
  register	                  0
  active_checks_enabled           1
  passive_checks_enabled          1
  parallelize_check               1
  obsess_over_service             1
  check_freshness                 0
  notifications_enabled           1
  event_handler_enabled           0
  flap_detection_enabled          1
  failure_prediction_enabled      1
  process_perf_data               0
  retain_status_information       1
  retain_nonstatus_information    1
  notification_interval           0
  is_volatile                     0
  normal_check_interval           1
  retry_check_interval            1
  max_check_attempts              1
  notification_options            u,c,w,r,f,s
  notification_period             24X7
  check_period                    24X7
}

# Sub-Template used for checks using performance data
define service {
  name				  check_mk_perf
  register			  0
  process_perf_data 		  1
  action_url			  /pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=$SERVICEDESC$' class='tips' rel='/pnp4nagios/index.php/popup?host=$HOSTNAME$&srv=$SERVICEDESC$
}

# This template is used by the service that actively
# calls check_mk. Each host has exactly one service
# using this template. Here you can configure, how often
# each host should be checked.
define service {
  name				  check_mk_active
  use				  check_mk_perf,check_mk_default
  register			  0
  check_command			  check-mk
  active_checks_enabled 	  1
}

# This template is used for inventory checks. They
# are generated if you set inventory_check_interval
# to a number > 0 in main.mk
define service {
  name				  check_mk_inventory
  use                             check_mk_default
  register			  0
  check_command			  check-mk-inventory
  active_checks_enabled 	  1
}


# Check_mk knows, which checks have performance data
# and assigns this template to these. You might need
# to adapt the action_url.
define service {
  name				  check_mk_passive_perf
  use				  check_mk_perf,check_mk_default
  register			  0
  active_checks_enabled 	  0
}

# This is used for checks without performance data.
define service {
  name				  check_mk_passive
  use				  check_mk_default
  register			  0
  active_checks_enabled 	  0
}

# This template is used for aggregated services (on the
# summary hosts). The never have performance data. A
# check command must be defined - even if never called.
# Notifications for aggregated services are disabled.
# Otherwise you would get them twice.
define service {
  name				  check_mk_summarized
  use				  check_mk_passive
  check_command			  check-mk-dummy  ; never called
  register			  0
  notifications_enabled		  0
}


# Hosts with no configured or autodetected service will
# get one service that is derived from the following
# template. This is needed, because Nagios does not
# allow a host without any service.
define service {
  name				  check_mk_pingonly
  use				  check_mk_default
  register			  0
  check_command                   check-mk-ping
  service_description             PING
  process_perf_data		  0
  active_checks_enabled           1
}


#      ____                  _                _
#     / ___|  ___ _ ____   _(_) ___ ___    __| | ___ _ __  ___
#     \___ \ / _ \ '__\ \ / / |/ __/ _ \  / _` |/ _ \ '_ \/ __|
#      ___) |  __/ |   \ V /| | (_|  __/ | (_| |  __/ |_) \__ \
#     |____/ \___|_|    \_/ |_|\___\___|  \__,_|\___| .__/|___/
#                                                   |_|

# This template is used by service dependencies created via
# the configuration variable service_dependencies. Since we
# only deal with passive checks the dependencies are not
# used to suppress service checks. But they are very useful
# for suppressing notifications. If you set inherits_parent
# to 1, then if A depends on B and B depends on C, A will
# automatically depend on C. This is usually what you want.
# If A depends on B and B is in WARNING state, the notification
# will *not* be suppressed. Check_mk generally uses WARNING state
# if the service is still working.
define servicedependency {
  name				  check_mk
  register			  0
  notification_failure_criteria   u,c   ; do not suppress in case of WARNING
  inherits_parent                 1
}


#       ____                                          _
#      / ___|___  _ __ ___  _ __ ___   __ _ _ __   __| |___
#     | |   / _ \| '_ ` _ \| '_ ` _ \ / _` | '_ \ / _` / __|
#     | |__| (_) | | | | | | | | | | | (_| | | | | (_| \__ \
#      \____\___/|_| |_| |_|_| |_| |_|\__,_|_| |_|\__,_|___/
#


# Calling check_mk with precompiled checks
define command {
  command_name	check-mk
  command_line  python /var/lib/check_mk/precompiled/"$HOSTNAME$"
}

# Use this variant of if you are working without precompiled
# checks (which is not recommended):
# define command {
#  command_name	check-mk
#  command_line /usr/bin/check_mk $HOSTNAME$ $HOSTADDRESS$
#}

# Inventory check
define command {
  command_name	check-mk-inventory
  command_line  /usr/bin/check_mk --cache --check-discovery "$HOSTNAME$"
}

define command {
  command_name  check-mk-dummy
  command_line  echo "DUMMY - Always OK"
}

# Commands for services of PING-only hosts
define command {
  command_name  check-mk-ping
  command_line  /usr/lib/nagios/plugins/check_icmp $ARG1$
}

# Host check commands
define command {
  command_name check-mk-host-ping
  command_line /usr/lib/nagios/plugins/check_icmp $ARG1$ $HOSTADDRESS$
}

define command {
  command_name check-mk-host-ping-cluster
  command_line /usr/lib/nagios/plugins/check_icmp -m 1 $ARG1$ $_HOSTNODEIPS$
}

define command {
  command_name  check-mk-host-ok
  command_line  echo "OK - Host is always assumed to be up"
}

define command {
  command_name  check-mk-host-tcp
  command_line  $USER1$/check_tcp -H $HOSTADDRESS$ -p $ARG1$
}


# General notification script. Details can be configured
# in main.mk via notification_... options
define command {
  command_name check-mk-notify
  command_line \
       NOTIFY_CONTACTNAME='$CONTACTNAME$' \
       NOTIFY_CONTACTEMAIL='$CONTACTEMAIL$' \
       NOTIFY_CONTACTPAGER='$CONTACTPAGER$' \
       NOTIFY_NOTIFICATIONTYPE='$NOTIFICATIONTYPE$' \
       NOTIFY_HOSTNOTIFICATIONNUMBER='$HOSTNOTIFICATIONNUMBER$' \
       NOTIFY_SERVICENOTIFICATIONNUMBER='$SERVICENOTIFICATIONNUMBER$' \
       NOTIFY_HOSTPROBLEMID='$HOSTPROBLEMID$' \
       NOTIFY_SERVICEPROBLEMID='$SERVICEPROBLEMID$' \
       NOTIFY_HOSTNAME='$HOSTNAME$' \
       NOTIFY_HOSTALIAS='$HOSTALIAS$' \
       NOTIFY_HOSTADDRESS='$HOSTADDRESS$' \
       NOTIFY_HOSTATTEMPT='$HOSTATTEMPT$' \
       NOTIFY_LASTHOSTSTATE='$LASTHOSTSTATE$' \
       NOTIFY_LASTHOSTSTATEID='$LASTHOSTSTATEID$' \
       NOTIFY_LASTHOSTSTATECHANGE='$LASTHOSTSTATECHANGE$' \
       NOTIFY_LASTHOSTUP='$LASTHOSTUP$' \
       NOTIFY_HOSTSTATE='$HOSTSTATE$' \
       NOTIFY_HOSTSTATEID='$HOSTSTATEID$' \
       NOTIFY_HOSTCHECKCOMMAND="$HOSTCHECKCOMMAND$" \
       NOTIFY_HOSTOUTPUT='$HOSTOUTPUT$' \
       NOTIFY_HOSTPERFDATA='$HOSTPERFDATA$' \
       NOTIFY_LONGHOSTOUTPUT='$LONGHOSTOUTPUT$' \
       NOTIFY_SERVICEDESC='$SERVICEDESC$' \
       NOTIFY_LASTSERVICESTATE='$LASTSERVICESTATE$' \
       NOTIFY_LASTSERVICESTATEID='$LASTSERVICESTATEID$' \
       NOTIFY_LASTSERVICESTATECHANGE='$LASTSERVICESTATECHANGE$' \
       NOTIFY_LASTSERVICEOK='$LASTSERVICEOK$' \
       NOTIFY_SERVICEATTEMPT='$SERVICEATTEMPT$' \
       NOTIFY_SERVICESTATE='$SERVICESTATE$' \
       NOTIFY_SERVICESTATEID='$SERVICESTATEID$' \
       NOTIFY_SERVICEOUTPUT='$SERVICEOUTPUT$' \
       NOTIFY_LONGSERVICEOUTPUT='$LONGSERVICEOUTPUT$' \
       NOTIFY_SERVICEPERFDATA='$SERVICEPERFDATA$' \
       NOTIFY_SERVICECHECKCOMMAND="$SERVICECHECKCOMMAND$" \
       NOTIFY_DATE='$DATE$' \
       NOTIFY_SHORTDATETIME='$SHORTDATETIME$' \
       NOTIFY_LONGDATETIME='$LONGDATETIME$' \
       NOTIFY_HOSTDOWNTIME='$HOSTDOWNTIME$' \
       NOTIFY_NOTIFICATIONCOMMENT='$NOTIFICATIONCOMMENT$' \
       NOTIFY_NOTIFICATIONAUTHOR='$NOTIFICATIONAUTHOR$' \
       NOTIFY_NOTIFICATIONAUTHORNAME='$NOTIFICATIONAUTHORNAME$' \
       NOTIFY_NOTIFICATIONAUTHORALIAS='$NOTIFICATIONAUTHORALIAS$' \
       NOTIFY_SERVICEACKAUTHOR='$SERVICEACKAUTHOR$' \
       NOTIFY_SERVICEACKCOMMENT='$SERVICEACKCOMMENT$' \
       NOTIFY_SERVICEGROUPNAMES='$SERVICEGROUPNAMES$' \
       NOTIFY_HOSTACKAUTHOR='$HOSTACKAUTHOR$' \
       NOTIFY_HOSTACKCOMMENT='$HOSTACKCOMMENT$' \
       NOTIFY_HOSTGROUPNAMES='$HOSTGROUPNAMES$' \
       NOTIFY_HOSTTAGS='$_HOSTTAGS$' \
       NOTIFY_HOST_SL='$_HOSTEC_SL$' \
       NOTIFY_SVC_SL='$_SERVICEEC_SL$' \
       NOTIFY_SERVICE_SL='$_SERVICEEC_SL$' \
       NOTIFY_HOST_EC_CONTACT='$_HOSTEC_CONTACT$' \
       NOTIFY_SERVICE_EC_CONTACT='$_SERVICEEC_CONTACT$' \
       NOTIFY_HOST_ADDRESS_4='$_HOSTADDRESS_4$' \
       NOTIFY_HOST_ADDRESS_6='$_HOSTADDRESS_6$' \
       NOTIFY_HOST_ADDRESS_FAMILY='$_HOSTADDRESS_FAMILY$' \
       /usr/bin/check_mk --notify
}


#      _____ _                                _           _
#     |_   _(_)_ __ ___   ___ _ __   ___ _ __(_) ___   __| |___
#       | | | | '_ ` _ \ / _ \ '_ \ / _ \ '__| |/ _ \ / _` / __|
#       | | | | | | | | |  __/ |_) |  __/ |  | | (_) | (_| \__ \
#       |_| |_|_| |_| |_|\___| .__/ \___|_|  |_|\___/ \__,_|___/
#                            |_|
#

# Make sure, timeperiod used in default template is available

define timeperiod {
    timeperiod_name 24X7
    alias           Dummy time period for check_mk
    sunday          00:00-24:00
    monday          00:00-24:00
    tuesday         00:00-24:00
    wednesday       00:00-24:00
    thursday        00:00-24:00
    friday          00:00-24:00
    saturday        00:00-24:00
}