mirror of https://github.com/Icinga/icinga2.git
349 lines
20 KiB
Markdown
349 lines
20 KiB
Markdown
# <a id="appendix"></a> Appendix
|
|
|
|
|
|
## <a id="schemas"></a> Schemas
|
|
|
|
By convention `CheckCommand`, `EventCommand` and `NotificationCommand` objects
|
|
are exported using a prefix. This is mandatory for unique objects in the
|
|
command tables.
|
|
|
|
Object | Prefix
|
|
------------------------|------------------------
|
|
CheckCommand | check_
|
|
EventCommand | event_
|
|
NotificationCommand | notification_
|
|
|
|
### <a id="schema-status-files"></a> Status Files
|
|
|
|
Status files used by Icinga 1.x Classic UI: `status.dat`, `objects.cache`.
|
|
|
|
Icinga 2 specific extensions:
|
|
|
|
* host and service objects support 'check_source' (added in Classic UI 1.10.0)
|
|
* command objects support custom variables (added in Classic UI 1.11.2)
|
|
* host and service objects support 'is_reachable' (added in Classic UI 1.11.3)
|
|
|
|
### <a id="schema-db-ido"></a> DB IDO
|
|
|
|
There is a detailed documentation for the Icinga IDOUtils 1.x
|
|
database schema available on [http://docs.icinga.org/latest/en/db_model.html]
|
|
|
|
#### <a id="schema-db-ido-extensions"></a> DB IDO Schema Extensions
|
|
|
|
Icinga 2 specific extensions are shown below:
|
|
|
|
New tables: `endpoints`, `endpointstatus`
|
|
|
|
Table | Column | Type | Default | Description
|
|
--------------------|--------------------|----------|---------|-------------
|
|
endpoints | endpoint_object_id | bigint | NULL | FK: objects table
|
|
endpoints | identity | TEXT | NULL | endpoint name
|
|
endpoints | node | TEXT | NULL | local node name
|
|
|
|
Table | Column | Type | Default | Description
|
|
--------------------|--------------------|----------|---------|-------------
|
|
endpointstatus | endpoint_object_id | bigint | NULL | FK: objects table
|
|
endpointstatus | identity | TEXT | NULL | endpoint name
|
|
endpointstatus | node | TEXT | NULL | local node name
|
|
endpointstatus | is_connected | smallint | 0 | update on endpoint connect/disconnect
|
|
|
|
New columns:
|
|
|
|
Table | Column | Type | Default | Description
|
|
--------------------|-------------------------|----------|---------|-------------
|
|
all status/history | endpoint_object_id | bigint | NULL | FK: objects table
|
|
servicestatus | check_source | TEXT | NULL | node name where check was executed
|
|
hoststatus | check_source | TEXT | NULL | node name where check was executed
|
|
statehistory | check_source | TEXT | NULL | node name where check was executed
|
|
servicestatus | is_reachable | integer | NULL | object reachability
|
|
hoststatus | is_reachable | integer | NULL | object reachability
|
|
logentries | object_id | bigint | NULL | FK: objects table (service associated with column)
|
|
{host,service}group | notes | TEXT | NULL | -
|
|
{host,service}group | notes_url | TEXT | NULL | -
|
|
{host,service}group | action_url | TEXT | NULL | -
|
|
|
|
Additional command custom variables populated from 'vars' dictionary.
|
|
Additional global custom variables populated from 'Vars' constant (object_id is NULL).
|
|
|
|
|
|
### <a id="schema-livestatus"></a> Livestatus
|
|
|
|
|
|
#### <a id="schema-livestatus-tables"></a> Livestatus Tables
|
|
|
|
Table | Join |Description
|
|
--------------|-----------|----------------------------
|
|
hosts | | host config and status attributes, services counter
|
|
hostgroups | | hostgroup config, status attributes and host/service counters
|
|
services | hosts | service config and status attributes
|
|
servicegroups | | servicegroup config, status attributes and service counters
|
|
contacts | | contact config and status attributes
|
|
contactgroups | | contact config, members
|
|
commands | | command name and line
|
|
status | | programstatus, config and stats
|
|
comments | services | status attributes
|
|
downtimes | services | status attributes
|
|
timeperiods | | name and is inside flag
|
|
endpoints | | config and status attributes
|
|
log | services, hosts, contacts, commands | parses [compatlog](#objecttype-compatlogger) and shows log attributes
|
|
statehist | hosts, services | parses [compatlog](#objecttype-compatlogger) and aggregates state change attributes
|
|
|
|
The `commands` table is populated with `CheckCommand`, `EventCommand` and `NotificationCommand` objects.
|
|
|
|
|
|
#### <a id="schema-livestatus-table-attributes"></a> Livestatus Table Attributes
|
|
|
|
A detailed list which table attributes are supported can be found here: [https://wiki.icinga.org/display/icinga2/Livestatus#Livestatus-Attributes]
|
|
|
|
|
|
#### <a id="schema-livestatus-get-queries"></a> Livestatus GET Queries
|
|
|
|
$ echo -e 'GET services' | netcat 127.0.0.1 6558
|
|
|
|
$ cat servicegroups <<EOF
|
|
GET servicegroups
|
|
|
|
EOF
|
|
|
|
(cat servicegroups; sleep 1) | netcat 127.0.0.1 6558
|
|
|
|
#### <a id="schema-livestatus-command-queries"></a> Livestatus COMMAND Queries
|
|
|
|
A list of available external commands and their parameters can be found [here](#external-commands-list-detail)
|
|
|
|
$ echo -e 'COMMAND <externalcommandstring>' | netcat 127.0.0.1 6558
|
|
|
|
|
|
#### <a id="schema-livestatus-filters"></a> Livestatus Filters
|
|
|
|
and, or, negate
|
|
|
|
Operator | Negate | Description
|
|
----------|------------------------
|
|
= | != | Euqality
|
|
~ | !~ | Regex match
|
|
=~ | !=~ | Euqality ignoring case
|
|
~~ | !~~ | Regex ignoring case
|
|
> | | Less than
|
|
< | | Greater than
|
|
>= | | Less than or equal
|
|
<= | | Greater than or equal
|
|
|
|
|
|
#### <a id="schema-livestatus-stats"></a> Livestatus Stats
|
|
|
|
Schema: "Stats: aggregatefunction aggregateattribute"
|
|
|
|
Aggregate Function | Description
|
|
-------------------|--------------
|
|
sum |
|
|
min |
|
|
max |
|
|
avg | sum / count
|
|
std | standard deviation
|
|
suminv | sum (1 / value)
|
|
avginv | suminv / count
|
|
count | ordinary default for any stats query if not aggregate function defined
|
|
|
|
Example:
|
|
|
|
GET hosts
|
|
Filter: has_been_checked = 1
|
|
Filter: check_type = 0
|
|
Stats: sum execution_time
|
|
Stats: sum latency
|
|
Stats: sum percent_state_change
|
|
Stats: min execution_time
|
|
Stats: min latency
|
|
Stats: min percent_state_change
|
|
Stats: max execution_time
|
|
Stats: max latency
|
|
Stats: max percent_state_change
|
|
OutputFormat: json
|
|
ResponseHeader: fixed16
|
|
|
|
#### <a id="schema-livestatus-output"></a> Livestatus Output
|
|
|
|
* CSV
|
|
|
|
CSV Output uses two levels of array separators: The members array separator
|
|
is a comma (1st level) while extra info and host|service relation separator
|
|
is a pipe (2nd level).
|
|
|
|
Seperators can be set using ASCII codes like:
|
|
|
|
Separators: 10 59 44 124
|
|
|
|
* JSON
|
|
|
|
Default separators.
|
|
|
|
#### <a id="schema-livestatus-error-codes"></a> Livestatus Error Codes
|
|
|
|
Code | Description
|
|
----------|--------------
|
|
200 | OK
|
|
404 | Table does not exist
|
|
452 | Exception on query
|
|
|
|
#### <a id="schema-livestatus-extensions"></a> Livestatus Schema Extensions
|
|
|
|
Icinga 2 specific extensions are shown below:
|
|
|
|
New table: `endpoints`
|
|
|
|
Table | Column
|
|
----------|--------------
|
|
endpoints | name
|
|
endpoints | identity
|
|
endpoints | node
|
|
endpoints | is_connected
|
|
|
|
New columns:
|
|
|
|
Table | Column
|
|
----------|--------------
|
|
hosts | is_reachable
|
|
services | is_reachable
|
|
hosts | check_source
|
|
services | check_source
|
|
downtimes | triggers
|
|
downtimes | trigger_time
|
|
commands | custom_variable_names
|
|
commands | custom_variable_values
|
|
commands | custom_variables
|
|
commands | modified_attributes
|
|
commands | modified_attributes_list
|
|
status | custom_variable_names
|
|
status | custom_variable_values
|
|
status | custom_variables
|
|
|
|
Command custom variables reflect the local 'vars' dictionary.
|
|
Status custom variables reflect the global 'Vars' constant.
|
|
|
|
|
|
## <a id="external-commands-list-detail"></a> External Commands List
|
|
|
|
Additional details can be found in the [Icinga 1.x Documentation](http://docs.icinga.org/latest/en/extcommands2.html)
|
|
|
|
Command name | Parameters | Description
|
|
------------------------------------------|-----------------------------------|--------------------------
|
|
PROCESS_HOST_CHECK_RESULT | ;<host_name>;<status_code>;<plugin_output> (3) | -
|
|
PROCESS_SERVICE_CHECK_RESULT | ;<host_name>;<service_name>;<return_code>;<plugin_output> (4) | -
|
|
SCHEDULE_HOST_CHECK | ;<host_name>;<check_time> (2) | -
|
|
SCHEDULE_FORCED_HOST_CHECK | ;<host_name>;<check_time> (2) | -
|
|
SCHEDULE_SVC_CHECK | ;<host_name>;<service_name>;<check_time> (3) | -
|
|
SCHEDULE_FORCED_SVC_CHECK | ;<host_name>;<service_name>;<check_time> (3) | -
|
|
ENABLE_HOST_CHECK | ;<host_name> (1) | -
|
|
DISABLE_HOST_CHECK | ;<host_name> (1) | -
|
|
ENABLE_SVC_CHECK | ;<host_name>;<service_name> (2) | -
|
|
DISABLE_SVC_CHECK | ;<host_name>;<service_name> (2) | -
|
|
SHUTDOWN_PROCESS | - | -
|
|
RESTART_PROCESS | - | -
|
|
SCHEDULE_FORCED_HOST_SVC_CHECKS | ;<host_name>;<check_time> (2) | -
|
|
SCHEDULE_HOST_SVC_CHECKS | ;<host_name>;<check_time> (2) | -
|
|
ENABLE_HOST_SVC_CHECKS | ;<host_name> (1) | -
|
|
DISABLE_HOST_SVC_CHECKS | ;<host_name> (1) | -
|
|
ACKNOWLEDGE_SVC_PROBLEM | ;<host_name>;<service_name>;<sticky>;<notify>;<persistent>;<author>;<comment> (7) | Note: Icinga 2 treats all comments as persistent.
|
|
ACKNOWLEDGE_SVC_PROBLEM_EXPIRE | ;<host_name>;<service_name>;<sticky>;<notify>;<persistent>;<timestamp>;<author>;<comment> (8) | Note: Icinga 2 treats all comments as persistent.
|
|
REMOVE_SVC_ACKNOWLEDGEMENT | ;<host_name>;<service_name> (2) | -
|
|
ACKNOWLEDGE_HOST_PROBLEM | ;<host_name>;<sticky>;<notify>;<persistent>;<author>;<comment> (6) | Note: Icinga 2 treats all comments as persistent.
|
|
ACKNOWLEDGE_HOST_PROBLEM_EXPIRE | ;<host_name>;<sticky>;<notify>;<persistent>;<timestamp>;<author>;<comment> (7) | Note: Icinga 2 treats all comments as persistent.
|
|
REMOVE_HOST_ACKNOWLEDGEMENT | ;<host_name> (1) | -
|
|
DISABLE_HOST_FLAP_DETECTION | ;<host_name> (1) | -
|
|
ENABLE_HOST_FLAP_DETECTION | ;<host_name> (1) | -
|
|
DISABLE_SVC_FLAP_DETECTION | ;<host_name>;<service_name> (2) | -
|
|
ENABLE_SVC_FLAP_DETECTION | ;<host_name>;<service_name> (2) | -
|
|
ENABLE_HOSTGROUP_SVC_CHECKS | ;<hostgroup_name> (1) | -
|
|
DISABLE_HOSTGROUP_SVC_CHECKS | ;<hostgroup_name> (1) | -
|
|
ENABLE_SERVICEGROUP_SVC_CHECKS | ;<servicegroup_name> (1) | -
|
|
DISABLE_SERVICEGROUP_SVC_CHECKS | ;<servicegroup_name> (1) | -
|
|
ENABLE_PASSIVE_HOST_CHECKS | ;<host_name> (1) | -
|
|
DISABLE_PASSIVE_HOST_CHECKS | ;<host_name> (1) | -
|
|
ENABLE_PASSIVE_SVC_CHECKS | ;<host_name>;<service_name> (2) | -
|
|
DISABLE_PASSIVE_SVC_CHECKS | ;<host_name>;<service_name> (2) | -
|
|
ENABLE_SERVICEGROUP_PASSIVE_SVC_CHECKS | ;<servicegroup_name> (1) | -
|
|
DISABLE_SERVICEGROUP_PASSIVE_SVC_CHECKS | ;<servicegroup_name> (1) | -
|
|
ENABLE_HOSTGROUP_PASSIVE_SVC_CHECKS | ;<hostgroup_name> (1) | -
|
|
DISABLE_HOSTGROUP_PASSIVE_SVC_CHECKS | ;<hostgroup_name> (1) | -
|
|
PROCESS_FILE | ;<file_name>;<delete> (2) | -
|
|
SCHEDULE_SVC_DOWNTIME | ;<host_name>;<service_name>;<start_time>;<end_time>;<fixed>;<trigger_id>;<duration>;<author>;<comment> (9) | -
|
|
DEL_SVC_DOWNTIME | ;<downtime_id> (1) | -
|
|
SCHEDULE_HOST_DOWNTIME | ;<host_name>;<start_time>;<end_time>;<fixed>;<trigger_id>;<duration>;<author>;<comment> (8) | -
|
|
DEL_HOST_DOWNTIME | ;<downtime_id> (1) | -
|
|
SCHEDULE_HOST_SVC_DOWNTIME | ;<host_name>;<start_time>;<end_time>;<fixed>;<trigger_id>;<duration>;<author>;<comment> (8) | -
|
|
SCHEDULE_HOSTGROUP_HOST_DOWNTIME | ;<hostgroup_name>;<start_time>;<end_time>;<fixed>;<trigger_id>;<duration>;<author>;<comment> (8) | -
|
|
SCHEDULE_HOSTGROUP_SVC_DOWNTIME | ;<hostgroup_name>;<start_time>;<end_time>;<fixed>;<trigger_id>;<duration>;<author>;<comment> (8) | -
|
|
SCHEDULE_SERVICEGROUP_HOST_DOWNTIME | ;<servicegroup_name>;<start_time>;<end_time>;<fixed>;<trigger_id>;<duration>;<author>;<comment> (8) | -
|
|
SCHEDULE_SERVICEGROUP_SVC_DOWNTIME | ;<servicegroup_name>;<start_time>;<end_time>;<fixed>;<trigger_id>;<duration>;<author>;<comment> (8) | -
|
|
ADD_HOST_COMMENT | ;<host_name>;<persistent>;<author>;<comment> (4) | Note: Icinga 2 treats all comments as persistent.
|
|
DEL_HOST_COMMENT | ;<comment_id> (1) | -
|
|
ADD_SVC_COMMENT | ;<host_name>;<service_name>;<persistent>;<author>;<comment> (5) | Note: Icinga 2 treats all comments as persistent.
|
|
DEL_SVC_COMMENT | ;<comment_id> (1) | -
|
|
DEL_ALL_HOST_COMMENTS | ;<host_name> (1) | -
|
|
DEL_ALL_SVC_COMMENTS | ;<host_name>;<service_name> (2) | -
|
|
SEND_CUSTOM_HOST_NOTIFICATION | ;<host_name>;<options>;<author>;<comment> (4) | -
|
|
SEND_CUSTOM_SVC_NOTIFICATION | ;<host_name>;<service_name>;<options>;<author>;<comment> (5) | -
|
|
DELAY_HOST_NOTIFICATION | ;<host_name>;<notification_time> (2) | -
|
|
DELAY_SVC_NOTIFICATION | ;<host_name>;<service_name>;<notification_time> (3) | -
|
|
ENABLE_HOST_NOTIFICATIONS | ;<host_name> (1) | -
|
|
DISABLE_HOST_NOTIFICATIONS | ;<host_name> (1) | -
|
|
ENABLE_SVC_NOTIFICATIONS | ;<host_name>;<service_name> (2) | -
|
|
DISABLE_SVC_NOTIFICATIONS | ;<host_name>;<service_name> (2) | -
|
|
DISABLE_HOSTGROUP_HOST_CHECKS | ;<hostgroup_name> (1) | -
|
|
DISABLE_HOSTGROUP_PASSIVE_HOST_CHECKS | ;<hostgroup_name> (1) | -
|
|
DISABLE_SERVICEGROUP_HOST_CHECKS | ;<servicegroup_name> (1) | -
|
|
DISABLE_SERVICEGROUP_PASSIVE_HOST_CHECKS | ;<servicegroup_name> (1) | -
|
|
ENABLE_HOSTGROUP_HOST_CHECKS | ;<hostgroup_name> (1) | -
|
|
ENABLE_HOSTGROUP_PASSIVE_HOST_CHECKS | ;<hostgroup_name> (1) | -
|
|
ENABLE_SERVICEGROUP_HOST_CHECKS | ;<servicegroup_name> (1) | -
|
|
ENABLE_SERVICEGROUP_PASSIVE_HOST_CHECKS | ;<servicegroup_name> (1) | -
|
|
ENABLE_NOTIFICATIONS | - | -
|
|
DISABLE_NOTIFICATIONS | - | -
|
|
ENABLE_FLAP_DETECTION | - | -
|
|
DISABLE_FLAP_DETECTION | - | -
|
|
ENABLE_EVENT_HANDLERS | - | -
|
|
DISABLE_EVENT_HANDLERS | - | -
|
|
ENABLE_PERFORMANCE_DATA | - | -
|
|
DISABLE_PERFORMANCE_DATA | - | -
|
|
START_EXECUTING_HOST_CHECKS | - | -
|
|
STOP_EXECUTING_HOST_CHECKS | - | -
|
|
START_EXECUTING_SVC_CHECKS | - | -
|
|
STOP_EXECUTING_SVC_CHECKS | - | -
|
|
CHANGE_SVC_MODATTR | ;<host_name>;<service_name>;<value> (3) | -
|
|
CHANGE_HOST_MODATTR | ;<host_name>;<value> (2) | -
|
|
CHANGE_USER_MODATTR | ;<user_name>;<value> (2) | -
|
|
CHANGE_CHECKCOMMAND_MODATTR | ;<checkcommand_name>;<value> (2) | -
|
|
CHANGE_EVENTCOMMAND_MODATTR | ;<eventcommand_name>;<value> (2) | -
|
|
CHANGE_NOTIFICATIONCOMMAND_MODATTR | ;<notificationcommand_name>;<value> (2) | -
|
|
CHANGE_NORMAL_SVC_CHECK_INTERVAL | ;<host_name>;<service_name>;<check_interval> (3) | -
|
|
CHANGE_NORMAL_HOST_CHECK_INTERVAL | ;<host_name>;<check_interval> (2) | -
|
|
CHANGE_RETRY_SVC_CHECK_INTERVAL | ;<host_name>;<service_name>;<check_interval> (3) | -
|
|
CHANGE_RETRY_HOST_CHECK_INTERVAL | ;<host_name>;<check_interval> (2) | -
|
|
ENABLE_HOST_EVENT_HANDLER | ;<host_name> (1) | -
|
|
DISABLE_HOST_EVENT_HANDLER | ;<host_name> (1) | -
|
|
ENABLE_SVC_EVENT_HANDLER | ;<host_name>;<service_name> (2) | -
|
|
DISABLE_SVC_EVENT_HANDLER | ;<host_name>;<service_name> (2) | -
|
|
CHANGE_HOST_EVENT_HANDLER | ;<host_name>;<event_command_name> (2) | -
|
|
CHANGE_SVC_EVENT_HANDLER | ;<host_name>;<service_name>;<event_command_name> (3) | -
|
|
CHANGE_HOST_CHECK_COMMAND | ;<host_name>;<check_command_name> (2) | -
|
|
CHANGE_SVC_CHECK_COMMAND | ;<host_name>;<service_name>;<check_command_name> (3) | -
|
|
CHANGE_MAX_HOST_CHECK_ATTEMPTS | ;<host_name>;<check_attempts> (2) | -
|
|
CHANGE_MAX_SVC_CHECK_ATTEMPTS | ;<host_name>;<service_name>;<check_attempts> (3) | -
|
|
CHANGE_HOST_CHECK_TIMEPERIOD | ;<host_name>;<timeperiod_name> (2) | -
|
|
CHANGE_SVC_CHECK_TIMEPERIOD | ;<host_name>;<service_name>;<timeperiod_name> | -
|
|
CHANGE_CUSTOM_HOST_VAR | ;<host_name>;<var_name>;<var_value> (3) | -
|
|
CHANGE_CUSTOM_SVC_VAR | ;<host_name>;<service_name>;<var_name>;<var_value> (4) | -
|
|
CHANGE_CUSTOM_USER_VAR | ;<user_name>;<var_name>;<var_value> (3) | -
|
|
CHANGE_CUSTOM_CHECKCOMMAND_VAR | ;<check_command_name>;<var_name>;<var_value> (3) | -
|
|
CHANGE_CUSTOM_EVENTCOMMAND_VAR | ;<event_command_name>;<var_name>;<var_value> (3) | -
|
|
CHANGE_CUSTOM_NOTIFICATIONCOMMAND_VAR | ;<notification_command_name>;<var_name>;<var_value> (3) | -
|
|
ENABLE_HOSTGROUP_HOST_NOTIFICATIONS | ;<hostgroup_name> (1) | -
|
|
ENABLE_HOSTGROUP_SVC_NOTIFICATIONS | ;<hostgroup_name> (1) | -
|
|
DISABLE_HOSTGROUP_HOST_NOTIFICATIONS | ;<hostgroup_name> (1) | -
|
|
DISABLE_HOSTGROUP_SVC_NOTIFICATIONS | ;<hostgroup_name> (1) | -
|
|
ENABLE_SERVICEGROUP_HOST_NOTIFICATIONS | ;<servicegroup_name> (1) | -
|
|
DISABLE_SERVICEGROUP_HOST_NOTIFICATIONS | ;<servicegroup_name> (1) | -
|
|
ENABLE_SERVICEGROUP_SVC_NOTIFICATIONS | ;<servicegroup_name> (1) | -
|
|
DISABLE_SERVICEGROUP_SVC_NOTIFICATIONS | ;<servicegroup_name> (1) | -
|