1 # <a id="appendix"></a> Appendix
4 ## <a id="schemas"></a> Schemas
6 By convention `CheckCommand`, `EventCommand` and `NotificationCommand` objects
7 are exported using a prefix. This is mandatory for unique objects in the
11 ------------------------|------------------------
14 NotificationCommand | notification_
16 ### <a id="schema-status-files"></a> Status Files
18 Status files used by Icinga 1.x Classic UI: `status.dat`, `objects.cache`.
20 Icinga 2 specific extensions:
22 * host and service objects support 'check_source' (added in Classic UI 1.10.0)
23 * command objects support custom variables (added in Classic UI 1.11.2)
24 * host and service objects support 'is_reachable' (added in Classic UI 1.11.3)
26 ### <a id="schema-db-ido"></a> DB IDO
28 There is a detailed documentation for the Icinga IDOUtils 1.x
29 database schema available on [http://docs.icinga.org/latest/en/db_model.html]
31 #### <a id="schema-db-ido-extensions"></a> DB IDO Schema Extensions
33 Icinga 2 specific extensions are shown below:
35 New tables: `endpoints`, `endpointstatus`
37 Table | Column | Type | Default | Description
38 --------------------|--------------------|----------|---------|-------------
39 endpoints | endpoint_object_id | bigint | NULL | FK: objects table
40 endpoints | identity | TEXT | NULL | endpoint name
41 endpoints | node | TEXT | NULL | local node name
43 Table | Column | Type | Default | Description
44 --------------------|--------------------|----------|---------|-------------
45 endpointstatus | endpoint_object_id | bigint | NULL | FK: objects table
46 endpointstatus | identity | TEXT | NULL | endpoint name
47 endpointstatus | node | TEXT | NULL | local node name
48 endpointstatus | is_connected | smallint | 0 | update on endpoint connect/disconnect
52 Table | Column | Type | Default | Description
53 --------------------|-------------------------|----------|---------|-------------
54 all status/history | endpoint_object_id | bigint | NULL | FK: objects table
55 servicestatus | check_source | TEXT | NULL | node name where check was executed
56 hoststatus | check_source | TEXT | NULL | node name where check was executed
57 statehistory | check_source | TEXT | NULL | node name where check was executed
58 servicestatus | is_reachable | integer | NULL | object reachability
59 hoststatus | is_reachable | integer | NULL | object reachability
60 logentries | object_id | bigint | NULL | FK: objects table (service associated with column)
61 {host,service}group | notes | TEXT | NULL | -
62 {host,service}group | notes_url | TEXT | NULL | -
63 {host,service}group | action_url | TEXT | NULL | -
65 Additional command custom variables populated from 'vars' dictionary.
66 Additional global custom variables populated from 'Vars' constant (object_id is NULL).
69 ### <a id="schema-livestatus"></a> Livestatus
72 #### <a id="schema-livestatus-tables"></a> Livestatus Tables
74 Table | Join |Description
75 --------------|-----------|----------------------------
76 hosts | | host config and status attributes, services counter
77 hostgroups | | hostgroup config, status attributes and host/service counters
78 services | hosts | service config and status attributes
79 servicegroups | | servicegroup config, status attributes and service counters
80 contacts | | contact config and status attributes
81 contactgroups | | contact config, members
82 commands | | command name and line
83 status | | programstatus, config and stats
84 comments | services | status attributes
85 downtimes | services | status attributes
86 timeperiods | | name and is inside flag
87 endpoints | | config and status attributes
88 log | services, hosts, contacts, commands | parses [compatlog](#objecttype-compatlogger) and shows log attributes
89 statehist | hosts, services | parses [compatlog](#objecttype-compatlogger) and aggregates state change attributes
91 The `commands` table is populated with `CheckCommand`, `EventCommand` and `NotificationCommand` objects.
94 #### <a id="schema-livestatus-table-attributes"></a> Livestatus Table Attributes
96 A detailed list which table attributes are supported can be found here: [https://wiki.icinga.org/display/icinga2/Livestatus#Livestatus-Attributes]
99 #### <a id="schema-livestatus-get-queries"></a> Livestatus GET Queries
101 $ echo -e 'GET services' | netcat 127.0.0.1 6558
103 $ cat servicegroups <<EOF
108 (cat servicegroups; sleep 1) | netcat 127.0.0.1 6558
110 #### <a id="schema-livestatus-command-queries"></a> Livestatus COMMAND Queries
112 A list of available external commands and their parameters can be found [here](#external-commands-list-detail)
114 $ echo -e 'COMMAND <externalcommandstring>' | netcat 127.0.0.1 6558
117 #### <a id="schema-livestatus-filters"></a> Livestatus Filters
121 Operator | Negate | Description
122 ----------|------------------------
125 =~ | !=~ | Euqality ignoring case
126 ~~ | !~~ | Regex ignoring case
129 >= | | Less than or equal
130 <= | | Greater than or equal
133 #### <a id="schema-livestatus-stats"></a> Livestatus Stats
135 Schema: "Stats: aggregatefunction aggregateattribute"
137 Aggregate Function | Description
138 -------------------|--------------
143 std | standard deviation
144 suminv | sum (1 / value)
145 avginv | suminv / count
146 count | ordinary default for any stats query if not aggregate function defined
151 Filter: has_been_checked = 1
152 Filter: check_type = 0
153 Stats: sum execution_time
155 Stats: sum percent_state_change
156 Stats: min execution_time
158 Stats: min percent_state_change
159 Stats: max execution_time
161 Stats: max percent_state_change
163 ResponseHeader: fixed16
165 #### <a id="schema-livestatus-output"></a> Livestatus Output
169 CSV Output uses two levels of array seperators: The members array separator
170 is a comma (1st level) while extra info and host|service relation separator
171 is a pipe (2nd level).
173 Seperators can be set using ASCII codes like:
175 Separators: 10 59 44 124
181 #### <a id="schema-livestatus-error-codes"></a> Livestatus Error Codes
184 ----------|--------------
186 404 | Table does not exist
187 452 | Exception on query
189 #### <a id="schema-livestatus-extensions"></a> Livestatus Schema Extensions
191 Icinga 2 specific extensions are shown below:
193 New table: `endpoints`
196 ----------|--------------
200 endpoints | is_connected
205 ----------|--------------
207 services | is_reachable
209 services | check_source
211 downtimes | trigger_time
212 commands | custom_variable_names
213 commands | custom_variable_values
214 commands | custom_variables
215 commands | modified_attributes
216 commands | modified_attributes_list
217 status | custom_variable_names
218 status | custom_variable_values
219 status | custom_variables
221 Command custom variables reflect the local 'vars' dictionary.
222 Status custom variables reflect the global 'Vars' constant.
225 ## <a id="external-commands-list-detail"></a> External Commands List
227 Additional details can be found in the [Icinga 1.x Documentation](http://docs.icinga.org/latest/en/extcommands2.html)
229 Command name | Parameters | Description
230 ------------------------------------------|-----------------------------------|--------------------------
231 PROCESS_HOST_CHECK_RESULT | ;<host_name>;<status_code>;<plugin_output> (3) | -
232 PROCESS_SERVICE_CHECK_RESULT | ;<host_name>;<service_name>;<return_code>;<plugin_output> (4) | -
233 SCHEDULE_HOST_CHECK | ;<host_name>;<check_time> (2) | -
234 SCHEDULE_FORCED_HOST_CHECK | ;<host_name>;<check_time> (2) | -
235 SCHEDULE_SVC_CHECK | ;<host_name>;<service_name>;<check_time> (3) | -
236 SCHEDULE_FORCED_SVC_CHECK | ;<host_name>;<service_name>;<check_time> (3) | -
237 ENABLE_HOST_CHECK | ;<host_name> (1) | -
238 DISABLE_HOST_CHECK | ;<host_name> (1) | -
239 ENABLE_SVC_CHECK | ;<host_name>;<service_name> (2) | -
240 DISABLE_SVC_CHECK | ;<host_name>;<service_name> (2) | -
241 SHUTDOWN_PROCESS | - | -
242 RESTART_PROCESS | - | -
243 SCHEDULE_FORCED_HOST_SVC_CHECKS | ;<host_name>;<check_time> (2) | -
244 SCHEDULE_HOST_SVC_CHECKS | ;<host_name>;<check_time> (2) | -
245 ENABLE_HOST_SVC_CHECKS | ;<host_name> (1) | -
246 DISABLE_HOST_SVC_CHECKS | ;<host_name> (1) | -
247 ACKNOWLEDGE_SVC_PROBLEM | ;<host_name>;<service_name>;<sticky>;<notify>;<persistent>;<author>;<comment> (7) | Note: Icinga 2 treats all comments as persistent.
248 ACKNOWLEDGE_SVC_PROBLEM_EXPIRE | ;<host_name>;<service_name>;<sticky>;<notify>;<persistent>;<timestamp>;<author>;<comment> (8) | Note: Icinga 2 treats all comments as persistent.
249 REMOVE_SVC_ACKNOWLEDGEMENT | ;<host_name>;<service_name> (2) | -
250 ACKNOWLEDGE_HOST_PROBLEM | ;<host_name>;<sticky>;<notify>;<persistent>;<author>;<comment> (6) | Note: Icinga 2 treats all comments as persistent.
251 ACKNOWLEDGE_HOST_PROBLEM_EXPIRE | ;<host_name>;<sticky>;<notify>;<persistent>;<timestamp>;<author>;<comment> (7) | Note: Icinga 2 treats all comments as persistent.
252 REMOVE_HOST_ACKNOWLEDGEMENT | ;<host_name> (1) | -
253 DISABLE_HOST_FLAP_DETECTION | ;<host_name> (1) | -
254 ENABLE_HOST_FLAP_DETECTION | ;<host_name> (1) | -
255 DISABLE_SVC_FLAP_DETECTION | ;<host_name>;<service_name> (2) | -
256 ENABLE_SVC_FLAP_DETECTION | ;<host_name>;<service_name> (2) | -
257 ENABLE_HOSTGROUP_SVC_CHECKS | ;<hostgroup_name> (1) | -
258 DISABLE_HOSTGROUP_SVC_CHECKS | ;<hostgroup_name> (1) | -
259 ENABLE_SERVICEGROUP_SVC_CHECKS | ;<servicegroup_name> (1) | -
260 DISABLE_SERVICEGROUP_SVC_CHECKS | ;<servicegroup_name> (1) | -
261 ENABLE_PASSIVE_HOST_CHECKS | ;<host_name> (1) | -
262 DISABLE_PASSIVE_HOST_CHECKS | ;<host_name> (1) | -
263 ENABLE_PASSIVE_SVC_CHECKS | ;<host_name>;<service_name> (2) | -
264 DISABLE_PASSIVE_SVC_CHECKS | ;<host_name>;<service_name> (2) | -
265 ENABLE_SERVICEGROUP_PASSIVE_SVC_CHECKS | ;<servicegroup_name> (1) | -
266 DISABLE_SERVICEGROUP_PASSIVE_SVC_CHECKS | ;<servicegroup_name> (1) | -
267 ENABLE_HOSTGROUP_PASSIVE_SVC_CHECKS | ;<hostgroup_name> (1) | -
268 DISABLE_HOSTGROUP_PASSIVE_SVC_CHECKS | ;<hostgroup_name> (1) | -
269 PROCESS_FILE | ;<file_name>;<delete> (2) | -
270 SCHEDULE_SVC_DOWNTIME | ;<host_name>;<service_name>;<start_time>;<end_time>;<fixed>;<trigger_id>;<duration>;<author>;<comment> (9) | -
271 DEL_SVC_DOWNTIME | ;<downtime_id> (1) | -
272 SCHEDULE_HOST_DOWNTIME | ;<host_name>;<start_time>;<end_time>;<fixed>;<trigger_id>;<duration>;<author>;<comment> (8) | -
273 DEL_HOST_DOWNTIME | ;<downtime_id> (1) | -
274 SCHEDULE_HOST_SVC_DOWNTIME | ;<host_name>;<start_time>;<end_time>;<fixed>;<trigger_id>;<duration>;<author>;<comment> (8) | -
275 SCHEDULE_HOSTGROUP_HOST_DOWNTIME | ;<hostgroup_name>;<start_time>;<end_time>;<fixed>;<trigger_id>;<duration>;<author>;<comment> (8) | -
276 SCHEDULE_HOSTGROUP_SVC_DOWNTIME | ;<hostgroup_name>;<start_time>;<end_time>;<fixed>;<trigger_id>;<duration>;<author>;<comment> (8) | -
277 SCHEDULE_SERVICEGROUP_HOST_DOWNTIME | ;<servicegroup_name>;<start_time>;<end_time>;<fixed>;<trigger_id>;<duration>;<author>;<comment> (8) | -
278 SCHEDULE_SERVICEGROUP_SVC_DOWNTIME | ;<servicegroup_name>;<start_time>;<end_time>;<fixed>;<trigger_id>;<duration>;<author>;<comment> (8) | -
279 ADD_HOST_COMMENT | ;<host_name>;<persistent>;<author>;<comment> (4) | Note: Icinga 2 treats all comments as persistent.
280 DEL_HOST_COMMENT | ;<comment_id> (1) | -
281 ADD_SVC_COMMENT | ;<host_name>;<service_name>;<persistent>;<author>;<comment> (5) | Note: Icinga 2 treats all comments as persistent.
282 DEL_SVC_COMMENT | ;<comment_id> (1) | -
283 DEL_ALL_HOST_COMMENTS | ;<host_name> (1) | -
284 DEL_ALL_SVC_COMMENTS | ;<host_name>;<service_name> (2) | -
285 SEND_CUSTOM_HOST_NOTIFICATION | ;<host_name>;<options>;<author>;<comment> (4) | -
286 SEND_CUSTOM_SVC_NOTIFICATION | ;<host_name>;<service_name>;<options>;<author>;<comment> (5) | -
287 DELAY_HOST_NOTIFICATION | ;<host_name>;<notification_time> (2) | -
288 DELAY_SVC_NOTIFICATION | ;<host_name>;<service_name>;<notification_time> (3) | -
289 ENABLE_HOST_NOTIFICATIONS | ;<host_name> (1) | -
290 DISABLE_HOST_NOTIFICATIONS | ;<host_name> (1) | -
291 ENABLE_SVC_NOTIFICATIONS | ;<host_name>;<service_name> (2) | -
292 DISABLE_SVC_NOTIFICATIONS | ;<host_name>;<service_name> (2) | -
293 DISABLE_HOSTGROUP_HOST_CHECKS | ;<hostgroup_name> (1) | -
294 DISABLE_HOSTGROUP_PASSIVE_HOST_CHECKS | ;<hostgroup_name> (1) | -
295 DISABLE_SERVICEGROUP_HOST_CHECKS | ;<servicegroup_name> (1) | -
296 DISABLE_SERVICEGROUP_PASSIVE_HOST_CHECKS | ;<servicegroup_name> (1) | -
297 ENABLE_HOSTGROUP_HOST_CHECKS | ;<hostgroup_name> (1) | -
298 ENABLE_HOSTGROUP_PASSIVE_HOST_CHECKS | ;<hostgroup_name> (1) | -
299 ENABLE_SERVICEGROUP_HOST_CHECKS | ;<servicegroup_name> (1) | -
300 ENABLE_SERVICEGROUP_PASSIVE_HOST_CHECKS | ;<servicegroup_name> (1) | -
301 ENABLE_NOTIFICATIONS | - | -
302 DISABLE_NOTIFICATIONS | - | -
303 ENABLE_FLAP_DETECTION | - | -
304 DISABLE_FLAP_DETECTION | - | -
305 ENABLE_EVENT_HANDLERS | - | -
306 DISABLE_EVENT_HANDLERS | - | -
307 ENABLE_PERFORMANCE_DATA | - | -
308 DISABLE_PERFORMANCE_DATA | - | -
309 START_EXECUTING_HOST_CHECKS | - | -
310 STOP_EXECUTING_HOST_CHECKS | - | -
311 START_EXECUTING_SVC_CHECKS | - | -
312 STOP_EXECUTING_SVC_CHECKS | - | -
313 CHANGE_SVC_MODATTR | ;<host_name>;<service_name>;<value> (3) | -
314 CHANGE_HOST_MODATTR | ;<host_name>;<value> (2) | -
315 CHANGE_USER_MODATTR | ;<user_name>;<value> (2) | -
316 CHANGE_CHECKCOMMAND_MODATTR | ;<checkcommand_name>;<value> (2) | -
317 CHANGE_EVENTCOMMAND_MODATTR | ;<eventcommand_name>;<value> (2) | -
318 CHANGE_NOTIFICATIONCOMMAND_MODATTR | ;<notificationcommand_name>;<value> (2) | -
319 CHANGE_NORMAL_SVC_CHECK_INTERVAL | ;<host_name>;<service_name>;<check_interval> (3) | -
320 CHANGE_NORMAL_HOST_CHECK_INTERVAL | ;<host_name>;<check_interval> (2) | -
321 CHANGE_RETRY_SVC_CHECK_INTERVAL | ;<host_name>;<service_name>;<check_interval> (3) | -
322 CHANGE_RETRY_HOST_CHECK_INTERVAL | ;<host_name>;<check_interval> (2) | -
323 ENABLE_HOST_EVENT_HANDLER | ;<host_name> (1) | -
324 DISABLE_HOST_EVENT_HANDLER | ;<host_name> (1) | -
325 ENABLE_SVC_EVENT_HANDLER | ;<host_name>;<service_name> (2) | -
326 DISABLE_SVC_EVENT_HANDLER | ;<host_name>;<service_name> (2) | -
327 CHANGE_HOST_EVENT_HANDLER | ;<host_name>;<event_command_name> (2) | -
328 CHANGE_SVC_EVENT_HANDLER | ;<host_name>;<service_name>;<event_command_name> (3) | -
329 CHANGE_HOST_CHECK_COMMAND | ;<host_name>;<check_command_name> (2) | -
330 CHANGE_SVC_CHECK_COMMAND | ;<host_name>;<service_name>;<check_command_name> (3) | -
331 CHANGE_MAX_HOST_CHECK_ATTEMPTS | ;<host_name>;<check_attempts> (2) | -
332 CHANGE_MAX_SVC_CHECK_ATTEMPTS | ;<host_name>;<service_name>;<check_attempts> (3) | -
333 CHANGE_HOST_CHECK_TIMEPERIOD | ;<host_name>;<timeperiod_name> (2) | -
334 CHANGE_SVC_CHECK_TIMEPERIOD | ;<host_name>;<service_name>;<timeperiod_name> | -
335 CHANGE_CUSTOM_HOST_VAR | ;<host_name>;<var_name>;<var_value> (3) | -
336 CHANGE_CUSTOM_SVC_VAR | ;<host_name>;<service_name>;<var_name>;<var_value> (4) | -
337 CHANGE_CUSTOM_USER_VAR | ;<user_name>;<var_name>;<var_value> (3) | -
338 CHANGE_CUSTOM_CHECKCOMMAND_VAR | ;<check_command_name>;<var_name>;<var_value> (3) | -
339 CHANGE_CUSTOM_EVENTCOMMAND_VAR | ;<event_command_name>;<var_name>;<var_value> (3) | -
340 CHANGE_CUSTOM_NOTIFICATIONCOMMAND_VAR | ;<notification_command_name>;<var_name>;<var_value> (3) | -
341 ENABLE_HOSTGROUP_HOST_NOTIFICATIONS | ;<hostgroup_name> (1) | -
342 ENABLE_HOSTGROUP_SVC_NOTIFICATIONS | ;<hostgroup_name> (1) | -
343 DISABLE_HOSTGROUP_HOST_NOTIFICATIONS | ;<hostgroup_name> (1) | -
344 DISABLE_HOSTGROUP_SVC_NOTIFICATIONS | ;<hostgroup_name> (1) | -
345 ENABLE_SERVICEGROUP_HOST_NOTIFICATIONS | ;<servicegroup_name> (1) | -
346 DISABLE_SERVICEGROUP_HOST_NOTIFICATIONS | ;<servicegroup_name> (1) | -
347 ENABLE_SERVICEGROUP_SVC_NOTIFICATIONS | ;<servicegroup_name> (1) | -
348 DISABLE_SERVICEGROUP_SVC_NOTIFICATIONS | ;<servicegroup_name> (1) | -