]> granicus.if.org Git - icinga2/blob - doc/14-features.md
Merge pull request #5394 from dupondje/add_mssql_args
[icinga2] / doc / 14-features.md
1 # Icinga 2 Features <a id="icinga2-features"></a>
2
3 ## Logging <a id="logging"></a>
4
5 Icinga 2 supports three different types of logging:
6
7 * File logging
8 * Syslog (on Linux/UNIX)
9 * Console logging (`STDOUT` on tty)
10
11 You can enable additional loggers using the `icinga2 feature enable`
12 and `icinga2 feature disable` commands to configure loggers:
13
14 Feature  | Description
15 ---------|------------
16 debuglog | Debug log (path: `/var/log/icinga2/debug.log`, severity: `debug` or higher)
17 mainlog  | Main log (path: `/var/log/icinga2/icinga2.log`, severity: `information` or higher)
18 syslog   | Syslog (severity: `warning` or higher)
19
20 By default file the `mainlog` feature is enabled. When running Icinga 2
21 on a terminal log messages with severity `information` or higher are
22 written to the console.
23
24 Packages will install a configuration file for logrotate on supported
25 platforms. This configuration ensures that the `icinga2.log`, `error.log` and
26 `debug.log` files are rotated on a daily basis.
27
28 ## DB IDO <a id="db-ido"></a>
29
30 The IDO (Icinga Data Output) modules for Icinga 2 take care of exporting all
31 configuration and status information into a database. The IDO database is used
32 by Icinga Web 2.
33
34 Details on the installation can be found in the [Configuring DB IDO](02-getting-started.md#configuring-db-ido-mysql)
35 chapter. Details on the configuration can be found in the
36 [IdoMysqlConnection](09-object-types.md#objecttype-idomysqlconnection) and
37 [IdoPgsqlConnection](09-object-types.md#objecttype-idopgsqlconnection)
38 object configuration documentation.
39 The DB IDO feature supports [High Availability](06-distributed-monitoring.md#distributed-monitoring-high-availability-db-ido) in
40 the Icinga 2 cluster.
41
42 The following example query checks the health of the current Icinga 2 instance
43 writing its current status to the DB IDO backend table `icinga_programstatus`
44 every 10 seconds. By default it checks 60 seconds into the past which is a reasonable
45 amount of time -- adjust it for your requirements. If the condition is not met,
46 the query returns an empty result.
47
48 > **Tip**
49 >
50 > Use [check plugins](05-service-monitoring.md#service-monitoring-plugins) to monitor the backend.
51
52 Replace the `default` string with your instance name if different.
53
54 Example for MySQL:
55
56     # mysql -u root -p icinga -e "SELECT status_update_time FROM icinga_programstatus ps
57       JOIN icinga_instances i ON ps.instance_id=i.instance_id
58       WHERE (UNIX_TIMESTAMP(ps.status_update_time) > UNIX_TIMESTAMP(NOW())-60)
59       AND i.instance_name='default';"
60
61     +---------------------+
62     | status_update_time  |
63     +---------------------+
64     | 2014-05-29 14:29:56 |
65     +---------------------+
66
67
68 Example for PostgreSQL:
69
70     # export PGPASSWORD=icinga; psql -U icinga -d icinga -c "SELECT ps.status_update_time FROM icinga_programstatus AS ps
71       JOIN icinga_instances AS i ON ps.instance_id=i.instance_id
72       WHERE ((SELECT extract(epoch from status_update_time) FROM icinga_programstatus) > (SELECT extract(epoch from now())-60))
73       AND i.instance_name='default'";
74
75     status_update_time
76     ------------------------
77      2014-05-29 15:11:38+02
78     (1 Zeile)
79
80
81 A detailed list on the available table attributes can be found in the [DB IDO Schema documentation](23-appendix.md#schema-db-ido).
82
83
84 ## External Commands <a id="external-commands"></a>
85
86 Icinga 2 provides an external command pipe for processing commands
87 triggering specific actions (for example rescheduling a service check
88 through the web interface).
89
90 In order to enable the `ExternalCommandListener` configuration use the
91 following command and restart Icinga 2 afterwards:
92
93     # icinga2 feature enable command
94
95 Icinga 2 creates the command pipe file as `/var/run/icinga2/cmd/icinga2.cmd`
96 using the default configuration.
97
98 Web interfaces and other Icinga addons are able to send commands to
99 Icinga 2 through the external command pipe, for example for rescheduling
100 a forced service check:
101
102     # /bin/echo "[`date +%s`] SCHEDULE_FORCED_SVC_CHECK;localhost;ping4;`date +%s`" >> /var/run/icinga2/cmd/icinga2.cmd
103
104     # tail -f /var/log/messages
105
106     Oct 17 15:01:25 icinga-server icinga2: Executing external command: [1382014885] SCHEDULE_FORCED_SVC_CHECK;localhost;ping4;1382014885
107     Oct 17 15:01:25 icinga-server icinga2: Rescheduling next check for service 'ping4'
108
109 A list of currently supported external commands can be found [here](23-appendix.md#external-commands-list-detail).
110
111 Detailed information on the commands and their required parameters can be found
112 on the [Icinga 1.x documentation](https://docs.icinga.com/latest/en/extcommands2.html).
113
114 ## Performance Data <a id="performance-data"></a>
115
116 When a host or service check is executed plugins should provide so-called
117 `performance data`. Next to that additional check performance data
118 can be fetched using Icinga 2 runtime macros such as the check latency
119 or the current service state (or additional custom attributes).
120
121 The performance data can be passed to external applications which aggregate and
122 store them in their backends. These tools usually generate graphs for historical
123 reporting and trending.
124
125 Well-known addons processing Icinga performance data are [PNP4Nagios](13-addons.md#addons-graphing-pnp),
126 [Graphite](13-addons.md#addons-graphing-graphite) or [OpenTSDB](14-features.md#opentsdb-writer).
127
128 ### Writing Performance Data Files <a id="writing-performance-data-files"></a>
129
130 PNP4Nagios and Graphios use performance data collector daemons to fetch
131 the current performance files for their backend updates.
132
133 Therefore the Icinga 2 [PerfdataWriter](09-object-types.md#objecttype-perfdatawriter)
134 feature allows you to define the output template format for host and services helped
135 with Icinga 2 runtime vars.
136
137     host_format_template = "DATATYPE::HOSTPERFDATA\tTIMET::$icinga.timet$\tHOSTNAME::$host.name$\tHOSTPERFDATA::$host.perfdata$\tHOSTCHECKCOMMAND::$host.check_command$\tHOSTSTATE::$host.state$\tHOSTSTATETYPE::$host.state_type$"
138     service_format_template = "DATATYPE::SERVICEPERFDATA\tTIMET::$icinga.timet$\tHOSTNAME::$host.name$\tSERVICEDESC::$service.name$\tSERVICEPERFDATA::$service.perfdata$\tSERVICECHECKCOMMAND::$service.check_command$\tHOSTSTATE::$host.state$\tHOSTSTATETYPE::$host.state_type$\tSERVICESTATE::$service.state$\tSERVICESTATETYPE::$service.state_type$"
139
140 The default templates are already provided with the Icinga 2 feature configuration
141 which can be enabled using
142
143     # icinga2 feature enable perfdata
144
145 By default all performance data files are rotated in a 15 seconds interval into
146 the `/var/spool/icinga2/perfdata/` directory as `host-perfdata.<timestamp>` and
147 `service-perfdata.<timestamp>`.
148 External collectors need to parse the rotated performance data files and then
149 remove the processed files.
150
151 ### Graphite Carbon Cache Writer <a id="graphite-carbon-cache-writer"></a>
152
153 While there are some [Graphite](13-addons.md#addons-graphing-graphite)
154 collector scripts and daemons like Graphios available for Icinga 1.x it's more
155 reasonable to directly process the check and plugin performance
156 in memory in Icinga 2. Once there are new metrics available, Icinga 2 will directly
157 write them to the defined Graphite Carbon daemon tcp socket.
158
159 You can enable the feature using
160
161     # icinga2 feature enable graphite
162
163 By default the [GraphiteWriter](09-object-types.md#objecttype-graphitewriter) feature
164 expects the Graphite Carbon Cache to listen at `127.0.0.1` on TCP port `2003`.
165
166 #### Current Graphite Schema <a id="graphite-carbon-cache-writer-schema"></a>
167
168 The current naming schema is defined as follows. The official Icinga Web 2 Graphite
169 module will use that schema too.
170
171 The default prefix for hosts and services is configured using
172 [runtime macros](03-monitoring-basics.md#runtime-macros)like this:
173
174     icinga2.$host.name$.host.$host.check_command$
175     icinga2.$host.name$.services.$service.name$.$service.check_command$
176
177 You can customize the prefix name by using the `host_name_template` and
178 `service_name_template` configuration attributes.
179
180 The additional levels will allow fine granular filters and also template
181 capabilities, e.g. by using the check command `disk` for specific
182 graph templates in web applications rendering the Graphite data.
183
184 The following characters are escaped in prefix labels:
185
186   Character     | Escaped character
187   --------------|--------------------------
188   whitespace    | _
189   .             | _
190   \             | _
191   /             | _
192
193 Metric values are stored like this:
194
195     <prefix>.perfdata.<perfdata-label>.value
196
197 The following characters are escaped in perfdata labels:
198
199   Character     | Escaped character
200   --------------|--------------------------
201   whitespace    | _
202   \             | _
203   /             | _
204   ::            | .
205
206 Note that perfdata labels may contain dots (`.`) allowing to
207 add more subsequent levels inside the Graphite tree.
208 `::` adds support for [multi performance labels](http://my-plugin.de/wiki/projects/check_multi/configuration/performance)
209 and is therefore replaced by `.`.
210
211 By enabling `enable_send_thresholds` Icinga 2 automatically adds the following threshold metrics:
212
213     <prefix>.perfdata.<perfdata-label>.min
214     <prefix>.perfdata.<perfdata-label>.max
215     <prefix>.perfdata.<perfdata-label>.warn
216     <prefix>.perfdata.<perfdata-label>.crit
217
218 By enabling `enable_send_metadata` Icinga 2 automatically adds the following metadata metrics:
219
220     <prefix>.metadata.current_attempt
221     <prefix>.metadata.downtime_depth
222     <prefix>.metadata.acknowledgement
223     <prefix>.metadata.execution_time
224     <prefix>.metadata.latency
225     <prefix>.metadata.max_check_attempts
226     <prefix>.metadata.reachable
227     <prefix>.metadata.state
228     <prefix>.metadata.state_type
229
230 Metadata metric overview:
231
232   metric             | description
233   -------------------|------------------------------------------
234   current_attempt    | current check attempt
235   max_check_attempts | maximum check attempts until the hard state is reached
236   reachable          | checked object is reachable
237   downtime_depth     | number of downtimes this object is in
238   acknowledgement    | whether the object is acknowledged or not
239   execution_time     | check execution time
240   latency            | check latency
241   state              | current state of the checked object
242   state_type         | 0=SOFT, 1=HARD state
243
244 The following example illustrates how to configure the storage schemas for Graphite Carbon
245 Cache.
246
247     [icinga2_default]
248     # intervals like PNP4Nagios uses them per default
249     pattern = ^icinga2\.
250     retentions = 1m:2d,5m:10d,30m:90d,360m:4y
251
252 #### Graphite Schema < 2.4 <a id="graphite-carbon-cache-writer-schema-legacy"></a>
253
254 > **Note**
255 >
256 > This legacy mode will be removed in 2.8.
257
258 In order to restore the old legacy schema, you'll need to adopt the `GraphiteWriter`
259 configuration:
260
261     object GraphiteWriter "graphite" {
262
263       enable_legacy_mode = true
264
265       host_name_template = "icinga.$host.name$"
266       service_name_template = "icinga.$host.name$.$service.name$"
267     }
268
269 The old legacy naming schema is
270
271     icinga.<hostname>.<metricname>
272     icinga.<hostname>.<servicename>.<metricname>
273
274 You can customize the metric prefix name by using the `host_name_template` and
275 `service_name_template` configuration attributes.
276
277 The example below uses [runtime macros](03-monitoring-basics.md#runtime-macros) and a
278 [global constant](17-language-reference.md#constants) named `GraphiteEnv`. The constant name
279 is freely definable and should be put in the [constants.conf](04-configuring-icinga-2.md#constants-conf) file.
280
281     const GraphiteEnv = "icinga.env1"
282
283     object GraphiteWriter "graphite" {
284       host_name_template = GraphiteEnv + ".$host.name$"
285       service_name_template = GraphiteEnv + ".$host.name$.$service.name$"
286     }
287
288 To make sure Icinga 2 writes a valid label into Graphite some characters are replaced
289 with `_` in the target name:
290
291     \/.-  (and space)
292
293 The resulting name in Graphite might look like:
294
295     www-01 / http-cert / response time
296     icinga.www_01.http_cert.response_time
297
298 In addition to the performance data retrieved from the check plugin, Icinga 2 sends
299 internal check statistic data to Graphite:
300
301   metric             | description
302   -------------------|------------------------------------------
303   current_attempt    | current check attempt
304   max_check_attempts | maximum check attempts until the hard state is reached
305   reachable          | checked object is reachable
306   downtime_depth     | number of downtimes this object is in
307   acknowledgement    | whether the object is acknowledged or not
308   execution_time     | check execution time
309   latency            | check latency
310   state              | current state of the checked object
311   state_type         | 0=SOFT, 1=HARD state
312
313 The following example illustrates how to configure the storage-schemas for Graphite Carbon
314 Cache. Please make sure that the order is correct because the first match wins.
315
316     [icinga_internals]
317     pattern = ^icinga\..*\.(max_check_attempts|reachable|current_attempt|execution_time|latency|state|state_type)
318     retentions = 5m:7d
319
320     [icinga_default]
321     # intervals like PNP4Nagios uses them per default
322     pattern = ^icinga\.
323     retentions = 1m:2d,5m:10d,30m:90d,360m:4y
324
325 ### InfluxDB Writer <a id="influxdb-writer"></a>
326
327 Once there are new metrics available, Icinga 2 will directly write them to the
328 defined InfluxDB HTTP API.
329
330 You can enable the feature using
331
332     # icinga2 feature enable influxdb
333
334 By default the [InfluxdbWriter](09-object-types.md#objecttype-influxdbwriter) feature
335 expects the InfluxDB daemon to listen at `127.0.0.1` on port `8086`.
336
337 More configuration details can be found [here](09-object-types.md#objecttype-influxdbwriter).
338
339 ### Graylog Integration <a id="graylog-integration"></a>
340
341 #### GELF Writer <a id="gelfwriter"></a>
342
343 The `Graylog Extended Log Format` (short: [GELF](http://docs.graylog.org/en/latest/pages/gelf.html))
344 can be used to send application logs directly to a TCP socket.
345
346 While it has been specified by the [Graylog](https://www.graylog.org) project as their
347 [input resource standard](http://docs.graylog.org/en/latest/pages/sending_data.html), other tools such as
348 [Logstash](https://www.elastic.co/products/logstash) also support `GELF` as
349 [input type](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-gelf.html).
350
351 You can enable the feature using
352
353     # icinga2 feature enable gelf
354
355 By default the `GelfWriter` object expects the GELF receiver to listen at `127.0.0.1` on TCP port `12201`.
356 The default `source`  attribute is set to `icinga2`. You can customize that for your needs if required.
357
358 Currently these events are processed:
359 * Check results
360 * State changes
361 * Notifications
362
363 ### Elastic Stack Integration <a id="elastic-stack-integration"></a>
364
365 [Icingabeat](https://github.com/icinga/icingabeat) is an Elastic Beat that fetches data
366 from the Icinga 2 API and sends it either directly to Elasticsearch or Logstash.
367
368 More integrations in development:
369 * [Logstash output](https://github.com/Icinga/logstash-output-icinga) for the Icinga 2 API.
370 * [Logstash Grok Pattern](https://github.com/Icinga/logstash-grok-pattern) for Icinga 2 logs.
371
372 ### OpenTSDB Writer <a id="opentsdb-writer"></a>
373
374 While there are some OpenTSDB collector scripts and daemons like tcollector available for
375 Icinga 1.x it's more reasonable to directly process the check and plugin performance
376 in memory in Icinga 2. Once there are new metrics available, Icinga 2 will directly
377 write them to the defined TSDB TCP socket.
378
379 You can enable the feature using
380
381     # icinga2 feature enable opentsdb
382
383 By default the `OpenTsdbWriter` object expects the TSD to listen at
384 `127.0.0.1` on port `4242`.
385
386 The current naming schema is
387
388     icinga.host.<metricname>
389     icinga.service.<servicename>.<metricname>
390
391 for host and service checks. The tag host is always applied.
392
393 To make sure Icinga 2 writes a valid metric into OpenTSDB some characters are replaced
394 with `_` in the target name:
395
396     \  (and space)
397
398 The resulting name in OpenTSDB might look like:
399
400     www-01 / http-cert / response time
401     icinga.http_cert.response_time
402
403 In addition to the performance data retrieved from the check plugin, Icinga 2 sends
404 internal check statistic data to OpenTSDB:
405
406   metric             | description
407   -------------------|------------------------------------------
408   current_attempt    | current check attempt
409   max_check_attempts | maximum check attempts until the hard state is reached
410   reachable          | checked object is reachable
411   downtime_depth     | number of downtimes this object is in
412   acknowledgement    | whether the object is acknowledged or not
413   execution_time     | check execution time
414   latency            | check latency
415   state              | current state of the checked object
416   state_type         | 0=SOFT, 1=HARD state
417
418 While reachable, state and state_type are metrics for the host or service the
419 other metrics follow the current naming schema
420
421     icinga.check.<metricname>
422
423 with the following tags
424
425   tag     | description
426   --------|------------------------------------------
427   type    | the check type, one of [host, service]
428   host    | hostname, the check ran on
429   service | the service name (if type=service)
430
431 > **Note**
432 >
433 > You might want to set the tsd.core.auto_create_metrics setting to `true`
434 > in your opentsdb.conf configuration file.
435
436
437 ## Livestatus <a id="setting-up-livestatus"></a>
438
439 The [MK Livestatus](https://mathias-kettner.de/checkmk_livestatus.html) project
440 implements a query protocol that lets users query their Icinga instance for
441 status information. It can also be used to send commands.
442
443 > **Tip**
444 >
445 > Only install the Livestatus feature if your web interface or addon requires
446 > you to do so (for example, [Icinga Web 2](02-getting-started.md#setting-up-icingaweb2)).
447 > Icinga Classic UI 1.x and Icinga Web 1.x do not use Livestatus as backend.
448
449 The Livestatus component that is distributed as part of Icinga 2 is a
450 re-implementation of the Livestatus protocol which is compatible with MK
451 Livestatus.
452
453 Details on the available tables and attributes with Icinga 2 can be found
454 in the [Livestatus Schema](23-appendix.md#schema-livestatus) section.
455
456 You can enable Livestatus using icinga2 feature enable:
457
458     # icinga2 feature enable livestatus
459
460 After that you will have to restart Icinga 2:
461
462 RHEL/CentOS 7/Fedora, SLES 12, Debian Jessie/Stretch, Ubuntu Xenial:
463
464     # systemctl restart icinga2
465
466 Debian/Ubuntu, RHEL/CentOS 6 and SUSE:
467
468     # service icinga2 restart
469
470 By default the Livestatus socket is available in `/var/run/icinga2/cmd/livestatus`.
471
472 In order for queries and commands to work you will need to add your query user
473 (e.g. your web server) to the `icingacmd` group:
474
475     # usermod -a -G icingacmd www-data
476
477 The Debian packages use `nagios` as the user and group name. Make sure to change `icingacmd` to
478 `nagios` if you're using Debian.
479
480 Change `www-data` to the user you're using to run queries.
481
482 In order to use the historical tables provided by the livestatus feature (for example, the
483 `log` table) you need to have the `CompatLogger` feature enabled. By default these logs
484 are expected to be in `/var/log/icinga2/compat`. A different path can be set using the
485 `compat_log_path` configuration attribute.
486
487     # icinga2 feature enable compatlog
488
489
490 ### Livestatus Sockets <a id="livestatus-sockets"></a>
491
492 Other to the Icinga 1.x Addon, Icinga 2 supports two socket types
493
494 * Unix socket (default)
495 * TCP socket
496
497 Details on the configuration can be found in the [LivestatusListener](09-object-types.md#objecttype-livestatuslistener)
498 object configuration.
499
500 ### Livestatus GET Queries <a id="livestatus-get-queries"></a>
501
502 > **Note**
503 >
504 > All Livestatus queries require an additional empty line as query end identifier.
505 > The `nc` tool (`netcat`) provides the `-U` parameter to communicate using
506 > a unix socket.
507
508 There also is a Perl module available in CPAN for accessing the Livestatus socket
509 programmatically: [Monitoring::Livestatus](http://search.cpan.org/~nierlein/Monitoring-Livestatus-0.74/)
510
511
512 Example using the unix socket:
513
514     # echo -e "GET services\n" | /usr/bin/nc -U /var/run/icinga2/cmd/livestatus
515
516 Example using the tcp socket listening on port `6558`:
517
518     # echo -e 'GET services\n' | netcat 127.0.0.1 6558
519
520     # cat servicegroups <<EOF
521     GET servicegroups
522
523     EOF
524
525     (cat servicegroups; sleep 1) | netcat 127.0.0.1 6558
526
527
528 ### Livestatus COMMAND Queries <a id="livestatus-command-queries"></a>
529
530 A list of available external commands and their parameters can be found [here](23-appendix.md#external-commands-list-detail)
531
532     $ echo -e 'COMMAND <externalcommandstring>' | netcat 127.0.0.1 6558
533
534
535 ### Livestatus Filters <a id="livestatus-filters"></a>
536
537 and, or, negate
538
539   Operator  | Negate   | Description
540   ----------|------------------------
541    =        | !=       | Equality
542    ~        | !~       | Regex match
543    =~       | !=~      | Equality ignoring case
544    ~~       | !~~      | Regex ignoring case
545    <        |          | Less than
546    >        |          | Greater than
547    <=       |          | Less than or equal
548    >=       |          | Greater than or equal
549
550
551 ### Livestatus Stats <a id="livestatus-stats"></a>
552
553 Schema: "Stats: aggregatefunction aggregateattribute"
554
555   Aggregate Function | Description
556   -------------------|--------------
557   sum                | &nbsp;
558   min                | &nbsp;
559   max                | &nbsp;
560   avg                | sum / count
561   std                | standard deviation
562   suminv             | sum (1 / value)
563   avginv             | suminv / count
564   count              | ordinary default for any stats query if not aggregate function defined
565
566 Example:
567
568     GET hosts
569     Filter: has_been_checked = 1
570     Filter: check_type = 0
571     Stats: sum execution_time
572     Stats: sum latency
573     Stats: sum percent_state_change
574     Stats: min execution_time
575     Stats: min latency
576     Stats: min percent_state_change
577     Stats: max execution_time
578     Stats: max latency
579     Stats: max percent_state_change
580     OutputFormat: json
581     ResponseHeader: fixed16
582
583 ### Livestatus Output <a id="livestatus-output"></a>
584
585 * CSV
586
587 CSV output uses two levels of array separators: The members array separator
588 is a comma (1st level) while extra info and host|service relation separator
589 is a pipe (2nd level).
590
591 Separators can be set using ASCII codes like:
592
593     Separators: 10 59 44 124
594
595 * JSON
596
597 Default separators.
598
599 ### Livestatus Error Codes <a id="livestatus-error-codes"></a>
600
601   Code      | Description
602   ----------|--------------
603   200       | OK
604   404       | Table does not exist
605   452       | Exception on query
606
607 ### Livestatus Tables <a id="livestatus-tables"></a>
608
609   Table         | Join      |Description
610   --------------|-----------|----------------------------
611   hosts         | &nbsp;    | host config and status attributes, services counter
612   hostgroups    | &nbsp;    | hostgroup config, status attributes and host/service counters
613   services      | hosts     | service config and status attributes
614   servicegroups | &nbsp;    | servicegroup config, status attributes and service counters
615   contacts      | &nbsp;    | contact config and status attributes
616   contactgroups | &nbsp;    | contact config, members
617   commands      | &nbsp;    | command name and line
618   status        | &nbsp;    | programstatus, config and stats
619   comments      | services  | status attributes
620   downtimes     | services  | status attributes
621   timeperiods   | &nbsp;    | name and is inside flag
622   endpoints     | &nbsp;    | config and status attributes
623   log           | services, hosts, contacts, commands | parses [compatlog](09-object-types.md#objecttype-compatlogger) and shows log attributes
624   statehist     | hosts, services | parses [compatlog](09-object-types.md#objecttype-compatlogger) and aggregates state change attributes
625   hostsbygroup  | hostgroups | host attributes grouped by hostgroup and its attributes
626   servicesbygroup | servicegroups | service attributes grouped by servicegroup and its attributes
627   servicesbyhostgroup  | hostgroups | service attributes grouped by hostgroup and its attributes
628
629 The `commands` table is populated with `CheckCommand`, `EventCommand` and `NotificationCommand` objects.
630
631 A detailed list on the available table attributes can be found in the [Livestatus Schema documentation](23-appendix.md#schema-livestatus).
632
633
634 ## Status Data Files <a id="status-data"></a>
635
636 Icinga 1.x writes object configuration data and status data in a cyclic
637 interval to its `objects.cache` and `status.dat` files. Icinga 2 provides
638 the `StatusDataWriter` object which dumps all configuration objects and
639 status updates in a regular interval.
640
641     # icinga2 feature enable statusdata
642
643 Icinga 1.x Classic UI requires this data set as part of its backend.
644
645 > **Note**
646 >
647 > If you are not using any web interface or addon which uses these files,
648 > you can safely disable this feature.
649
650
651 ## Compat Log Files <a id="compat-logging"></a>
652
653 The Icinga 1.x log format is considered being the `Compat Log`
654 in Icinga 2 provided with the `CompatLogger` object.
655
656 These logs are not only used for informational representation in
657 external web interfaces parsing the logs, but also to generate
658 SLA reports and trends in Icinga 1.x Classic UI. Furthermore the
659 [Livestatus](14-features.md#setting-up-livestatus) feature uses these logs for answering queries to
660 historical tables.
661
662 The `CompatLogger` object can be enabled with
663
664     # icinga2 feature enable compatlog
665
666 By default, the Icinga 1.x log file called `icinga.log` is located
667 in `/var/log/icinga2/compat`. Rotated log files are moved into
668 `var/log/icinga2/compat/archives`.
669
670 The format cannot be changed without breaking compatibility to
671 existing log parsers.
672
673     # tail -f /var/log/icinga2/compat/icinga.log
674
675     [1382115688] LOG ROTATION: HOURLY
676     [1382115688] LOG VERSION: 2.0
677     [1382115688] HOST STATE: CURRENT;localhost;UP;HARD;1;
678     [1382115688] SERVICE STATE: CURRENT;localhost;disk;WARNING;HARD;1;
679     [1382115688] SERVICE STATE: CURRENT;localhost;http;OK;HARD;1;
680     [1382115688] SERVICE STATE: CURRENT;localhost;load;OK;HARD;1;
681     [1382115688] SERVICE STATE: CURRENT;localhost;ping4;OK;HARD;1;
682     [1382115688] SERVICE STATE: CURRENT;localhost;ping6;OK;HARD;1;
683     [1382115688] SERVICE STATE: CURRENT;localhost;processes;WARNING;HARD;1;
684     [1382115688] SERVICE STATE: CURRENT;localhost;ssh;OK;HARD;1;
685     [1382115688] SERVICE STATE: CURRENT;localhost;users;OK;HARD;1;
686     [1382115706] EXTERNAL COMMAND: SCHEDULE_FORCED_SVC_CHECK;localhost;disk;1382115705
687     [1382115706] EXTERNAL COMMAND: SCHEDULE_FORCED_SVC_CHECK;localhost;http;1382115705
688     [1382115706] EXTERNAL COMMAND: SCHEDULE_FORCED_SVC_CHECK;localhost;load;1382115705
689     [1382115706] EXTERNAL COMMAND: SCHEDULE_FORCED_SVC_CHECK;localhost;ping4;1382115705
690     [1382115706] EXTERNAL COMMAND: SCHEDULE_FORCED_SVC_CHECK;localhost;ping6;1382115705
691     [1382115706] EXTERNAL COMMAND: SCHEDULE_FORCED_SVC_CHECK;localhost;processes;1382115705
692     [1382115706] EXTERNAL COMMAND: SCHEDULE_FORCED_SVC_CHECK;localhost;ssh;1382115705
693     [1382115706] EXTERNAL COMMAND: SCHEDULE_FORCED_SVC_CHECK;localhost;users;1382115705
694     [1382115731] EXTERNAL COMMAND: PROCESS_SERVICE_CHECK_RESULT;localhost;ping6;2;critical test|
695     [1382115731] SERVICE ALERT: localhost;ping6;CRITICAL;SOFT;2;critical test
696
697
698 ## Check Result Files <a id="check-result-files"></a>
699
700 Icinga 1.x writes its check result files to a temporary spool directory
701 where they are processed in a regular interval.
702 While this is extremely inefficient in performance regards it has been
703 rendered useful for passing passive check results directly into Icinga 1.x
704 skipping the external command pipe.
705
706 Several clustered/distributed environments and check-aggregation addons
707 use that method. In order to support step-by-step migration of these
708 environments, Icinga 2 supports the `CheckResultReader` object.
709
710 There is no feature configuration available, but it must be defined
711 on-demand in your Icinga 2 objects configuration.
712
713     object CheckResultReader "reader" {
714       spool_dir = "/data/check-results"
715     }
716