]> granicus.if.org Git - icinga2/blob - doc/4-advanced-topics.md
Documentation: Refactor RemoteClient/Cluster/etc from community&training feedback
[icinga2] / doc / 4-advanced-topics.md
1 # <a id="advanced-topics"></a> Advanced Topics
2
3 This chapter covers a number of advanced topics. If you're new to Icinga you
4 can safely skip over things you're not interested in.
5
6 ## <a id="downtimes"></a> Downtimes
7
8 Downtimes can be scheduled for planned server maintenance or
9 any other targetted service outage you are aware of in advance.
10
11 Downtimes will suppress any notifications, and may trigger other
12 downtimes too. If the downtime was set by accident, or the duration
13 exceeds the maintenance, you can manually cancel the downtime.
14 Planned downtimes will also be taken into account for SLA reporting
15 tools calculating the SLAs based on the state and downtime history.
16
17 Multiple downtimes for a single object may overlap. This is useful
18 when you want to extend your maintenance window taking longer than expected.
19 If there are multiple downtimes triggered for one object, the overall downtime depth
20 will be greater than `1`.
21
22
23 If the downtime was scheduled after the problem changed to a critical hard
24 state triggering a problem notification, and the service recovers during
25 the downtime window, the recovery notification won't be suppressed.
26
27 ### <a id="fixed-flexible-downtimes"></a> Fixed and Flexible Downtimes
28
29 A `fixed` downtime will be activated at the defined start time, and
30 removed at the end time. During this time window the service state
31 will change to `NOT-OK` and then actually trigger the downtime.
32 Notifications are suppressed and the downtime depth is incremented.
33
34 Common scenarios are a planned distribution upgrade on your linux
35 servers, or database updates in your warehouse. The customer knows
36 about a fixed downtime window between 23:00 and 24:00. After 24:00
37 all problems should be alerted again. Solution is simple -
38 schedule a `fixed` downtime starting at 23:00 and ending at 24:00.
39
40 Unlike a `fixed` downtime, a `flexible` downtime will be triggered
41 by the state change in the time span defined by start and end time,
42 and then last for the specified duration in minutes.
43
44 Imagine the following scenario: Your service is frequently polled
45 by users trying to grab free deleted domains for immediate registration.
46 Between 07:30 and 08:00 the impact will hit for 15 minutes and generate
47 a network outage visible to the monitoring. The service is still alive,
48 but answering too slow to Icinga 2 service checks.
49 For that reason, you may want to schedule a downtime between 07:30 and
50 08:00 with a duration of 15 minutes. The downtime will then last from
51 its trigger time until the duration is over. After that, the downtime
52 is removed (may happen before or after the actual end time!).
53
54 ### <a id="scheduling-downtime"></a> Scheduling a downtime
55
56 This can either happen through a web interface or by sending an [external command](4-advanced-topics.md#external-commands)
57 to the external command pipe provided by the `ExternalCommandListener` configuration.
58
59 Fixed downtimes require a start and end time (a duration will be ignored).
60 Flexible downtimes need a start and end time for the time span, and a duration
61 independent from that time span.
62
63 ### <a id="triggered-downtimes"></a> Triggered Downtimes
64
65 This is optional when scheduling a downtime. If there is already a downtime
66 scheduled for a future maintenance, the current downtime can be triggered by
67 that downtime. This renders useful if you have scheduled a host downtime and
68 are now scheduling a child host's downtime getting triggered by the parent
69 downtime on NOT-OK state change.
70
71 ### <a id="recurring-downtimes"></a> Recurring Downtimes
72
73 [ScheduledDowntime objects](6-object-types.md#objecttype-scheduleddowntime) can be used to set up
74 recurring downtimes for services.
75
76 Example:
77
78     apply ScheduledDowntime "backup-downtime" to Service {
79       author = "icingaadmin"
80       comment = "Scheduled downtime for backup"
81
82       ranges = {
83         monday = "02:00-03:00"
84         tuesday = "02:00-03:00"
85         wednesday = "02:00-03:00"
86         thursday = "02:00-03:00"
87         friday = "02:00-03:00"
88         saturday = "02:00-03:00"
89         sunday = "02:00-03:00"
90       }
91
92       assign where "backup" in service.groups
93     }
94
95
96 ## <a id="comments-intro"></a> Comments
97
98 Comments can be added at runtime and are persistent over restarts. You can
99 add useful information for others on repeating incidents (for example
100 "last time syslog at 100% cpu on 17.10.2013 due to stale nfs mount") which
101 is primarly accessible using web interfaces.
102
103 Adding and deleting comment actions are possible through the external command pipe
104 provided with the `ExternalCommandListener` configuration. The caller must
105 pass the comment id in case of manipulating an existing comment.
106
107
108 ## <a id="acknowledgements"></a> Acknowledgements
109
110 If a problem is alerted and notified you may signal the other notification
111 recipients that you are aware of the problem and will handle it.
112
113 By sending an acknowledgement to Icinga 2 (using the external command pipe
114 provided with `ExternalCommandListener` configuration) all future notifications
115 are suppressed, a new comment is added with the provided description and
116 a notification with the type `NotificationFilterAcknowledgement` is sent
117 to all notified users.
118
119 ### <a id="expiring-acknowledgements"></a> Expiring Acknowledgements
120
121 Once a problem is acknowledged it may disappear from your `handled problems`
122 dashboard and no-one ever looks at it again since it will suppress
123 notifications too.
124
125 This `fire-and-forget` action is quite common. If you're sure that a
126 current problem should be resolved in the future at a defined time,
127 you can define an expiration time when acknowledging the problem.
128
129 Icinga 2 will clear the acknowledgement when expired and start to
130 re-notify if the problem persists.
131
132
133 ## <a id="timeperiods"></a> Time Periods
134
135 Time Periods define time ranges in Icinga where event actions are
136 triggered, for example whether a service check is executed or not within
137 the `check_period` attribute. Or a notification should be sent to
138 users or not, filtered by the `period` and `notification_period`
139 configuration attributes for `Notification` and `User` objects.
140
141 > **Note**
142 >
143 > If you are familar with Icinga 1.x - these time period definitions
144 > are called `legacy timeperiods` in Icinga 2.
145 >
146 > An Icinga 2 legacy timeperiod requires the `ITL` provided template
147 >`legacy-timeperiod`.
148
149 The `TimePeriod` attribute `ranges` may contain multiple directives,
150 including weekdays, days of the month, and calendar dates.
151 These types may overlap/override other types in your ranges dictionary.
152
153 The descending order of precedence is as follows:
154
155 * Calendar date (2008-01-01)
156 * Specific month date (January 1st)
157 * Generic month date (Day 15)
158 * Offset weekday of specific month (2nd Tuesday in December)
159 * Offset weekday (3rd Monday)
160 * Normal weekday (Tuesday)
161
162 If you don't set any `check_period` or `notification_period` attribute
163 on your configuration objects Icinga 2 assumes `24x7` as time period
164 as shown below.
165
166     object TimePeriod "24x7" {
167       import "legacy-timeperiod"
168
169       display_name = "Icinga 2 24x7 TimePeriod"
170       ranges = {
171         "monday"    = "00:00-24:00"
172         "tuesday"   = "00:00-24:00"
173         "wednesday" = "00:00-24:00"
174         "thursday"  = "00:00-24:00"
175         "friday"    = "00:00-24:00"
176         "saturday"  = "00:00-24:00"
177         "sunday"    = "00:00-24:00"
178       }
179     }
180
181 If your operation staff should only be notified during workhours
182 create a new timeperiod named `workhours` defining a work day from
183 09:00 to 17:00.
184
185     object TimePeriod "workhours" {
186       import "legacy-timeperiod"
187
188       display_name = "Icinga 2 8x5 TimePeriod"
189       ranges = {
190         "monday"    = "09:00-17:00"
191         "tuesday"   = "09:00-17:00"
192         "wednesday" = "09:00-17:00"
193         "thursday"  = "09:00-17:00"
194         "friday"    = "09:00-17:00"
195       }
196     }
197
198 Use the `period` attribute to assign time periods to
199 `Notification` and `Dependency` objects:
200
201     object Notification "mail" {
202       import "generic-notification"
203
204       host_name = "localhost"
205
206       command = "mail-notification"
207       users = [ "icingaadmin" ]
208       period = "workhours"
209     }
210
211  
212 ## <a id="check-result-freshness"></a> Check Result Freshness
213
214 In Icinga 2 active check freshness is enabled by default. It is determined by the
215 `check_interval` attribute and no incoming check results in that period of time.
216
217     threshold = last check execution time + check interval
218
219 Passive check freshness is calculated from the `check_interval` attribute if set.
220
221     threshold = last check result time + check interval
222
223 If the freshness checks are invalid, a new check is executed defined by the
224 `check_command` attribute.
225
226
227 ## <a id="check-flapping"></a> Check Flapping
228
229 The flapping algorithm used in Icinga 2 does not store the past states but
230 calculcates the flapping threshold from a single value based on counters and
231 half-life values. Icinga 2 compares the value with a single flapping threshold
232 configuration attribute named `flapping_threshold`.
233
234 Flapping detection can be enabled or disabled using the `enable_flapping` attribute.
235
236
237 ## <a id="volatile-services"></a> Volatile Services
238
239 By default all services remain in a non-volatile state. When a problem
240 occurs, the `SOFT` state applies and once `max_check_attempts` attribute
241 is reached with the check counter, a `HARD` state transition happens.
242 Notifications are only triggered by `HARD` state changes and are then
243 re-sent defined by the `interval` attribute.
244
245 It may be reasonable to have a volatile service which stays in a `HARD`
246 state type if the service stays in a `NOT-OK` state. That way each
247 service recheck will automatically trigger a notification unless the
248 service is acknowledged or in a scheduled downtime.
249
250
251 ## <a id="external-commands"></a> External Commands
252
253 Icinga 2 provides an external command pipe for processing commands
254 triggering specific actions (for example rescheduling a service check
255 through the web interface).
256
257 In order to enable the `ExternalCommandListener` configuration use the
258 following command and restart Icinga 2 afterwards:
259
260     # icinga2 feature enable command
261
262 Icinga 2 creates the command pipe file as `/var/run/icinga2/cmd/icinga2.cmd`
263 using the default configuration.
264
265 Web interfaces and other Icinga addons are able to send commands to
266 Icinga 2 through the external command pipe, for example for rescheduling
267 a forced service check:
268
269     # /bin/echo "[`date +%s`] SCHEDULE_FORCED_SVC_CHECK;localhost;ping4;`date +%s`" >> /var/run/icinga2/cmd/icinga2.cmd
270
271     # tail -f /var/log/messages
272
273     Oct 17 15:01:25 icinga-server icinga2: Executing external command: [1382014885] SCHEDULE_FORCED_SVC_CHECK;localhost;ping4;1382014885
274     Oct 17 15:01:25 icinga-server icinga2: Rescheduling next check for service 'ping4'
275
276 A list of currently supported external commands can be found [here](22-appendix.md#external-commands-list-detail).
277
278 Detailed information on the commands and their required parameters can be found
279 on the [Icinga 1.x documentation](http://docs.icinga.org/latest/en/extcommands2.html).
280
281 ## <a id="logging"></a> Logging
282
283 Icinga 2 supports three different types of logging:
284
285 * File logging
286 * Syslog (on *NIX-based operating systems)
287 * Console logging (`STDOUT` on tty)
288
289 You can enable additional loggers using the `icinga2 feature enable`
290 and `icinga2 feature disable` commands to configure loggers:
291
292 Feature  | Description
293 ---------|------------
294 debuglog | Debug log (path: `/var/log/icinga2/debug.log`, severity: `debug` or higher)
295 mainlog  | Main log (path: `/var/log/icinga2/icinga2.log`, severity: `information` or higher)
296 syslog   | Syslog (severity: `warning` or higher)
297
298 By default file the `mainlog` feature is enabled. When running Icinga 2
299 on a terminal log messages with severity `information` or higher are
300 written to the console.
301
302 ## <a id="performance-data"></a> Performance Data
303
304 When a host or service check is executed plugins should provide so-called
305 `performance data`. Next to that additional check performance data
306 can be fetched using Icinga 2 runtime macros such as the check latency
307 or the current service state (or additional custom attributes).
308
309 The performance data can be passed to external applications which aggregate and
310 store them in their backends. These tools usually generate graphs for historical
311 reporting and trending.
312
313 Well-known addons processing Icinga performance data are PNP4Nagios,
314 inGraph and Graphite.
315
316 ### <a id="writing-performance-data-files"></a> Writing Performance Data Files
317
318 PNP4Nagios, inGraph and Graphios use performance data collector daemons to fetch
319 the current performance files for their backend updates.
320
321 Therefore the Icinga 2 `PerfdataWriter` object allows you to define
322 the output template format for host and services backed with Icinga 2
323 runtime vars.
324
325     host_format_template = "DATATYPE::HOSTPERFDATA\tTIMET::$icinga.timet$\tHOSTNAME::$host.name$\tHOSTPERFDATA::$host.perfdata$\tHOSTCHECKCOMMAND::$host.checkcommand$\tHOSTSTATE::$host.state$\tHOSTSTATETYPE::$host.statetype$"
326     service_format_template = "DATATYPE::SERVICEPERFDATA\tTIMET::$icinga.timet$\tHOSTNAME::$host.name$\tSERVICEDESC::$service.name$\tSERVICEPERFDATA::$service.perfdata$\tSERVICECHECKCOMMAND::$service.checkcommand$\tHOSTSTATE::$host.state$\tHOSTSTATETYPE::$host.statetype$\tSERVICESTATE::$service.state$\tSERVICESTATETYPE::$service.statetype$"
327
328 The default templates are already provided with the Icinga 2 feature configuration
329 which can be enabled using
330
331     # icinga2 feature enable perfdata
332
333 By default all performance data files are rotated in a 15 seconds interval into
334 the `/var/spool/icinga2/perfdata/` directory as `host-perfdata.<timestamp>` and
335 `service-perfdata.<timestamp>`.
336 External collectors need to parse the rotated performance data files and then
337 remove the processed files.
338
339 ### <a id="graphite-carbon-cache-writer"></a> Graphite Carbon Cache Writer
340
341 While there are some Graphite collector scripts and daemons like Graphios available for
342 Icinga 1.x it's more reasonable to directly process the check and plugin performance
343 in memory in Icinga 2. Once there are new metrics available, Icinga 2 will directly
344 write them to the defined Graphite Carbon daemon tcp socket.
345
346 You can enable the feature using
347
348     # icinga2 feature enable graphite
349
350 By default the `GraphiteWriter` object expects the Graphite Carbon Cache to listen at
351 `127.0.0.1` on TCP port `2003`.
352
353 The current naming schema is
354
355     icinga.<hostname>.<metricname>
356     icinga.<hostname>.<servicename>.<metricname>
357
358 You can customize the metric prefix name by using the `host_name_template` and
359 `service_name_template` configuration attributes.
360
361 The example below uses [runtime macros](3-monitoring-basics.md#runtime-macros) and a
362 [global constant](19-language-reference.md#constants) named `GraphiteEnv`. The constant name
363 is freely definable and should be put in the [constants.conf](5-configuring-icinga-2.md#constants-conf) file.
364
365     const GraphiteEnv = "icinga.env1"
366
367     object GraphiteWriter "graphite" {
368       host_name_template = GraphiteEnv + ".$host.name$"
369       service_name_template = GraphiteEnv + ".$host.name$.$service.name$"
370     }
371
372 To make sure Icinga 2 writes a valid label into Graphite some characters are replaced
373 with `_` in the target name:
374
375     \/.-  (and space)
376
377 The resulting name in Graphite might look like:
378
379     www-01 / http-cert / response time
380     icinga.www_01.http_cert.response_time
381
382 In addition to the performance data retrieved from the check plugin, Icinga 2 sends
383 internal check statistic data to Graphite:
384
385   metric             | description
386   -------------------|------------------------------------------
387   current_attempt    | current check attempt
388   max_check_attempts | maximum check attempts until the hard state is reached
389   reachable          | checked object is reachable
390   downtime_depth     | number of downtimes this object is in
391   execution_time     | check execution time
392   latency            | check latency
393   state              | current state of the checked object
394   state_type         | 0=SOFT, 1=HARD state
395
396 The following example illustrates how to configure the storage-schemas for Graphite Carbon
397 Cache. Please make sure that the order is correct because the first match wins.
398
399     [icinga_internals]
400     pattern = ^icinga\..*\.(max_check_attempts|reachable|current_attempt|execution_time|latency|state|state_type)
401     retentions = 5m:7d
402
403     [icinga_default]
404     # intervals like PNP4Nagios uses them per default
405     pattern = ^icinga\.
406     retentions = 1m:2d,5m:10d,30m:90d,360m:4y
407
408 ### <a id="gelfwriter"></a> GELF Writer
409
410 The `Graylog Extended Log Format` (short: [GELF](http://www.graylog2.org/resources/gelf))
411 can be used to send application logs directly to a TCP socket.
412
413 While it has been specified by the [graylog2](http://www.graylog2.org/) project as their
414 [input resource standard](http://www.graylog2.org/resources/gelf), other tools such as
415 [Logstash](http://www.logstash.net) also support `GELF` as
416 [input type](http://logstash.net/docs/latest/inputs/gelf).
417
418 You can enable the feature using
419
420     # icinga2 feature enable gelf
421
422 By default the `GelfWriter` object expects the GELF receiver to listen at `127.0.0.1` on TCP port `12201`.
423 The default `source`  attribute is set to `icinga2`. You can customize that for your needs if required.
424
425 Currently these events are processed:
426 * Check results
427 * State changes
428 * Notifications
429
430 ### <a id="opentsdb-writer"></a> OpenTSDB Writer
431
432 While there are some OpenTSDB collector scripts and daemons like tcollector available for
433 Icinga 1.x it's more reasonable to directly process the check and plugin performance
434 in memory in Icinga 2. Once there are new metrics available, Icinga 2 will directly
435 write them to the defined TSDB TCP socket.
436
437 You can enable the feature using
438
439     # icinga2 feature enable opentsdb
440
441 By default the `OpenTsdbWriter` object expects the TSD to listen at
442 `127.0.0.1` on port `4242`.
443
444 The current naming schema is
445
446     icinga.host.<metricname>
447     icinga.service.<servicename>.<metricname>
448
449 for host and service checks. The tag host is always applied.
450
451 To make sure Icinga 2 writes a valid metric into OpenTSDB some characters are replaced
452 with `_` in the target name:
453
454     \  (and space)
455
456 The resulting name in OpenTSDB might look like:
457
458     www-01 / http-cert / response time
459     icinga.http_cert.response_time
460
461 In addition to the performance data retrieved from the check plugin, Icinga 2 sends
462 internal check statistic data to OpenTSDB:
463
464   metric             | description
465   -------------------|------------------------------------------
466   current_attempt    | current check attempt
467   max_check_attempts | maximum check attempts until the hard state is reached
468   reachable          | checked object is reachable
469   downtime_depth     | number of downtimes this object is in
470   execution_time     | check execution time
471   latency            | check latency
472   state              | current state of the checked object
473   state_type         | 0=SOFT, 1=HARD state
474
475 While reachable, state and state_type are metrics for the host or service the
476 other metrics follow the current naming schema
477
478     icinga.check.<metricname>
479
480 with the following tags
481
482   tag     | description
483   --------|------------------------------------------
484   type    | the check type, one of [host, service]
485   host    | hostname, the check ran on
486   service | the service name (if type=service)
487
488 > **Note**
489 >
490 > You might want to set the tsd.core.auto_create_metrics setting to `true`
491 > in your opentsdb.conf configuration file.
492
493
494 ## <a id="status-data"></a> Status Data
495
496 Icinga 1.x writes object configuration data and status data in a cyclic
497 interval to its `objects.cache` and `status.dat` files. Icinga 2 provides
498 the `StatusDataWriter` object which dumps all configuration objects and
499 status updates in a regular interval.
500
501     # icinga2 feature enable statusdata
502
503 Icinga 1.x Classic UI requires this data set as part of its backend.
504
505 > **Note**
506 >
507 > If you are not using any web interface or addon which uses these files
508 > you can safely disable this feature.
509
510
511 ## <a id="compat-logging"></a> Compat Logging
512
513 The Icinga 1.x log format is considered being the `Compat Log`
514 in Icinga 2 provided with the `CompatLogger` object.
515
516 These logs are not only used for informational representation in
517 external web interfaces parsing the logs, but also to generate
518 SLA reports and trends in Icinga 1.x Classic UI. Furthermore the
519 [Livestatus](15-livestatus.md#setting-up-livestatus) feature uses these logs for answering queries to
520 historical tables.
521
522 The `CompatLogger` object can be enabled with
523
524     # icinga2 feature enable compatlog
525
526 By default, the Icinga 1.x log file called `icinga.log` is located
527 in `/var/log/icinga2/compat`. Rotated log files are moved into
528 `var/log/icinga2/compat/archives`.
529
530 The format cannot be changed without breaking compatibility to
531 existing log parsers.
532
533     # tail -f /var/log/icinga2/compat/icinga.log
534
535     [1382115688] LOG ROTATION: HOURLY
536     [1382115688] LOG VERSION: 2.0
537     [1382115688] HOST STATE: CURRENT;localhost;UP;HARD;1;
538     [1382115688] SERVICE STATE: CURRENT;localhost;disk;WARNING;HARD;1;
539     [1382115688] SERVICE STATE: CURRENT;localhost;http;OK;HARD;1;
540     [1382115688] SERVICE STATE: CURRENT;localhost;load;OK;HARD;1;
541     [1382115688] SERVICE STATE: CURRENT;localhost;ping4;OK;HARD;1;
542     [1382115688] SERVICE STATE: CURRENT;localhost;ping6;OK;HARD;1;
543     [1382115688] SERVICE STATE: CURRENT;localhost;processes;WARNING;HARD;1;
544     [1382115688] SERVICE STATE: CURRENT;localhost;ssh;OK;HARD;1;
545     [1382115688] SERVICE STATE: CURRENT;localhost;users;OK;HARD;1;
546     [1382115706] EXTERNAL COMMAND: SCHEDULE_FORCED_SVC_CHECK;localhost;disk;1382115705
547     [1382115706] EXTERNAL COMMAND: SCHEDULE_FORCED_SVC_CHECK;localhost;http;1382115705
548     [1382115706] EXTERNAL COMMAND: SCHEDULE_FORCED_SVC_CHECK;localhost;load;1382115705
549     [1382115706] EXTERNAL COMMAND: SCHEDULE_FORCED_SVC_CHECK;localhost;ping4;1382115705
550     [1382115706] EXTERNAL COMMAND: SCHEDULE_FORCED_SVC_CHECK;localhost;ping6;1382115705
551     [1382115706] EXTERNAL COMMAND: SCHEDULE_FORCED_SVC_CHECK;localhost;processes;1382115705
552     [1382115706] EXTERNAL COMMAND: SCHEDULE_FORCED_SVC_CHECK;localhost;ssh;1382115705
553     [1382115706] EXTERNAL COMMAND: SCHEDULE_FORCED_SVC_CHECK;localhost;users;1382115705
554     [1382115731] EXTERNAL COMMAND: PROCESS_SERVICE_CHECK_RESULT;localhost;ping6;2;critical test|
555     [1382115731] SERVICE ALERT: localhost;ping6;CRITICAL;SOFT;2;critical test
556
557
558
559
560 ## <a id="db-ido"></a> DB IDO
561
562 The IDO (Icinga Data Output) modules for Icinga 2 take care of exporting all
563 configuration and status information into a database. The IDO database is used
564 by a number of projects including Icinga Web 1.x and 2.
565
566 Details on the installation can be found in the [Configuring DB IDO](2-getting-started.md#configuring-db-ido-mysql)
567 chapter. Details on the configuration can be found in the
568 [IdoMysqlConnection](6-object-types.md#objecttype-idomysqlconnection) and
569 [IdoPgsqlConnection](6-object-types.md#objecttype-idopgsqlconnection)
570 object configuration documentation.
571 The DB IDO feature supports [High Availability](12-distributed-monitoring-ha.md#high-availability-db-ido) in
572 the Icinga 2 cluster.
573
574 The following example query checks the health of the current Icinga 2 instance
575 writing its current status to the DB IDO backend table `icinga_programstatus`
576 every 10 seconds. By default it checks 60 seconds into the past which is a reasonable
577 amount of time - adjust it for your requirements. If the condition is not met,
578 the query returns an empty result.
579
580 > **Tip**
581 >
582 > Use [check plugins](13-addons-plugins.md#plugins) to monitor the backend.
583
584 Replace the `default` string with your instance name, if different.
585
586 Example for MySQL:
587
588     # mysql -u root -p icinga -e "SELECT status_update_time FROM icinga_programstatus ps
589       JOIN icinga_instances i ON ps.instance_id=i.instance_id
590       WHERE (UNIX_TIMESTAMP(ps.status_update_time) > UNIX_TIMESTAMP(NOW())-60)
591       AND i.instance_name='default';"
592
593     +---------------------+
594     | status_update_time  |
595     +---------------------+
596     | 2014-05-29 14:29:56 |
597     +---------------------+
598
599
600 Example for PostgreSQL:
601
602     # export PGPASSWORD=icinga; psql -U icinga -d icinga -c "SELECT ps.status_update_time FROM icinga_programstatus AS ps
603       JOIN icinga_instances AS i ON ps.instance_id=i.instance_id
604       WHERE ((SELECT extract(epoch from status_update_time) FROM icinga_programstatus) > (SELECT extract(epoch from now())-60))
605       AND i.instance_name='default'";
606
607     status_update_time
608     ------------------------
609      2014-05-29 15:11:38+02
610     (1 Zeile)
611
612
613 A detailed list on the available table attributes can be found in the [DB IDO Schema documentation](22-appendix.md#schema-db-ido).
614
615
616 ## <a id="check-result-files"></a> Check Result Files
617
618 Icinga 1.x writes its check result files to a temporary spool directory
619 where they are processed in a regular interval.
620 While this is extremely inefficient in performance regards it has been
621 rendered useful for passing passive check results directly into Icinga 1.x
622 skipping the external command pipe.
623
624 Several clustered/distributed environments and check-aggregation addons
625 use that method. In order to support step-by-step migration of these
626 environments, Icinga 2 supports the `CheckResultReader` object.
627
628 There is no feature configuration available, but it must be defined
629 on-demand in your Icinga 2 objects configuration.
630
631     object CheckResultReader "reader" {
632       spool_dir = "/data/check-results"
633     }