You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
New ways to configure Icinga DB were introduced in [icingadb-831] and
[igl-113]. The first change allows configuring Icinga DB using
environment variables instead of or next to the YAML configuration file.
In addition, the second change allows setting certificates and keys as
PEM-encoded strings next to referencing files. This was now documented.
As a structural change, the order of the Database and Redis sections
were changed to reflect the order in the example configuration file.
Some words about the Logging Components were written, as the
documentation previously that they exist.
[icingadb-831]: #831
[igl-113]: Icinga/icinga-go-library#113
| host |**Required.** Host name or address, or absolute Unix socket path. |
17
-
| port |**Optional.** TCP port. Defaults to `6380` matching the Redis® open source server port in the `icingadb-redis` package. |
18
-
| username |**Optional.** Authentication username, requires a `password` being set as well. |
19
-
| password |**Optional.** Authentication password. May be used alone or together with a `username`. |
20
-
| database |**Optional.** Numerical database identifier, defaults to `0`. |
21
-
| tls |**Optional.** Whether to use TLS. |
22
-
| cert |**Optional.** Path to TLS client certificate. |
23
-
| key |**Optional.** Path to TLS private key. |
24
-
| ca |**Optional.** Path to TLS CA certificate. |
25
-
| insecure |**Optional.** Whether not to verify the peer. |
9
+
The following subsections describe the configurations of the various modules.
10
+
For the YAML configuration file, each option is written in lowercase, as shown in the tables.
11
+
When using environment variables, the variable name is constructed by concatenating `ICINGADB_`, the module name in uppercase followed by an underscore, and the option name in uppercase.
12
+
The hyphens in the names are to be replaced by underscores.
13
+
For example, to set the database host, the `ICINGADB_DATABASE_HOST` environment variable is used.
26
14
27
15
## Database Configuration
28
16
29
-
Connection configuration for the database to which Icinga DB synchronizes monitoring data.
17
+
Connection configuration for the SQL database to which Icinga DB synchronizes monitoring data.
30
18
This is also the database used in
31
19
[Icinga DB Web](https://icinga.com/docs/icinga-db-web) to view and work with the data.
32
-
In high availability setups, all Icinga DB instances must write to the same database.
20
+
21
+
In [high availability setups](05-Distributed-Setups.md), all Icinga DB instances must write to the same database.
22
+
23
+
For YAML configuration, the options are part of the `database` dictionary.
24
+
For environment variables, each option is prefixed with`ICINGADB_DATABASE_`.
@@ -40,9 +32,9 @@ In high availability setups, all Icinga DB instances must write to the same data
40
32
| user |**Required.** Database username. |
41
33
| password |**Optional.** Database password. |
42
34
| tls |**Optional.** Whether to use TLS. |
43
-
| cert |**Optional.**Path to TLS client certificate. |
44
-
| key |**Optional.**Path to TLS private key. |
45
-
| ca |**Optional.**Path to TLS CA certificate. |
35
+
| cert |**Optional.** TLS client certificate, either file path or PEM-encoded multiline string.|
36
+
| key |**Optional.** TLS client private key, either file path or PEM-encoded multiline string.|
37
+
| ca |**Optional.** TLS CA certificate, either file path or PEM-encoded multiline string.|
46
38
| insecure |**Optional.** Whether not to verify the peer. |
47
39
| options |**Optional.** List of low-level [database options](#database-options) that can be set to influence some Icinga DB internal default behaviours. |
48
40
@@ -55,7 +47,10 @@ do not need any manual adjustments.
55
47
56
48
!!! important
57
49
58
-
Do not change the defaults if you do not have to!
50
+
Do not change the defaults unless you have to!
51
+
52
+
For YAML configuration, the options are part of the `database.options` dictionary.
53
+
For environment variables, each option is prefixed with `ICINGADB_DATABASE_OPTIONS_`.
@@ -65,11 +60,39 @@ do not need any manual adjustments.
65
60
| max_rows_per_transaction |**Optional.** Maximum number of rows Icinga DB is allowed to `SELECT`,`DELETE`,`UPDATE` or `INSERT` in a single transaction. Defaults to `8192`. |
66
61
| wsrep_sync_wait |**Optional.** Enforce [Galera cluster](#galera-cluster) nodes to perform strict cluster-wide causality checks. Defaults to `7`. |
67
62
63
+
## Redis® Configuration
64
+
65
+
Connection configuration for the Redis® server where Icinga 2 writes its configuration, state and history items.
66
+
This is the same connection as configured in the
67
+
[Icinga DB feature](https://icinga.com/docs/icinga-2/latest/doc/14-features/#icinga-db) of
68
+
the corresponding Icinga 2 node.
69
+
70
+
High availability setups require a dedicated Redis® server per Icinga 2 node and therefore a dedicated Icinga DB instance that connects to it.
71
+
72
+
For YAML configuration, the options are part of the `redis` dictionary.
73
+
For environment variables, each option is prefixed with `ICINGADB_REDIS_`.
| level |**Optional.** Specifies the default logging level. Can be set to `fatal`, `error`, `warn`, `info` or `debug`. Defaults to `info`. |
75
98
| output |**Optional.** Configures the logging output. Can be set to `console` (stderr) or `systemd-journald`. Defaults to systemd-journald when running under systemd, otherwise to console. See notes below for [systemd-journald](#systemd-journald-fields). |
@@ -78,6 +101,32 @@ Configuration of the logging component used by Icinga DB.
78
101
79
102
### Logging Components
80
103
104
+
The independent components of Icinga DB produce log entries.
105
+
Each log entry is linked to its component and a log level.
106
+
107
+
By default, any log message will be displayed if its log level is at or above the `level` configured above.
108
+
However, it is possible to override the log level for each component individually to show more or less information.
109
+
110
+
For YAML configuration, the options are part of the `logging.options` dictionary.
111
+
For environment variables, `ICINGADB_LOGGING_OPTIONS` expects a single string of `component:level` pairs joined with `,`.
112
+
113
+
The following example would log everything with at least info level, except database and high availability entries, where the level is one time raised and one time lowered.
| history-days |**Optional.** Number of days to retain historical data for all history categories. Use `options` in order to enable retention only for specific categories or to override the retention days configured here. |
107
-
| sla-days |**Optional.** Number of days to retain historical data for SLA reporting. |
108
-
| interval |**Optional.** Interval for periodically cleaning up the historical data, defined as [duration string](#duration-string). Defaults to `"1h"`. |
109
-
| count |**Optional.** Number of old historical data a single query can delete in a `"DELETE FROM ... LIMIT count"` manner. Defaults to `5000`. |
110
-
| options |**Optional.** Map of history category to number of days to retain its data. Available categories are `acknowledgement`, `comment`, `downtime`, `flapping`, `notification`, `sla` and `state`. |
153
+
For YAML configuration, the options are part of the `retention` dictionary.
154
+
For environment variables, each option is prefixed with `ICINGADB_RETENTION_`.
155
+
156
+
When using environment variables, the Retention `options` are formatted similar to the [logging components](#logging-components) from above.
| history-days |**Optional.** Number of days to retain historical data for all history categories. Use `options` in order to enable retention only for specific categories or to override the retention days configured here. |
167
+
| sla-days |**Optional.** Number of days to retain historical data for SLA reporting. |
168
+
| interval |**Optional.** Interval for periodically cleaning up the historical data, defined as [duration string](#duration-string). Defaults to `"1h"`. |
169
+
| count |**Optional.** Number of old historical data a single query can delete in a `"DELETE FROM ... LIMIT count"` manner. Defaults to `5000`. |
170
+
| options |**Optional.** Map of history category to number of days to retain its data. Available categories are `acknowledgement`, `comment`, `downtime`, `flapping`, `notification`, `state`, `sla_downtime` and `sla_state`. |
0 commit comments