13014 Commits

Author SHA1 Message Date
Julian Brost
3f86f236e5
Merge pull request #9421 from Icinga/IcingaDB-soft_state-2.13
Icinga DB: icinga:*:state: rename state to soft_state
2022-06-29 14:18:33 +02:00
Alexander A. Klimov
b2245be53c Icinga DB: icinga:*:state: rename state to soft_state 2022-06-29 12:30:38 +02:00
Alexander Aleksandrovič Klimov
d35f823a96
Merge pull request #9419 from Icinga/feature/adjust-some-column-names-2.13
IcingaDB: Adjust some column names according to the DB schema
2022-06-28 22:00:00 +02:00
Alexander Aleksandrovič Klimov
8ff3f2aeb1
Merge pull request #9418 from Icinga/feature/icingadb-no-ca-error-message-2.13
Icinga DB: make error message more helpful if API isn't set up
2022-06-28 20:08:24 +02:00
Alexander Aleksandrovič Klimov
d1ccbdbe3d
Merge pull request #9417 from Icinga/feature/icingadb-check-2.13
Introduce Icinga DB check (like the IDO one)
2022-06-28 19:18:57 +02:00
Yonas Habteab
a9acb3c9d9 IcingaDB: Adjust some column names according to the DB schema 2022-06-28 16:46:52 +02:00
Julian Brost
0d0c2678d9 Icinga DB: make error message more helpful if API isn't set up 2022-06-28 15:57:42 +02:00
Julian Brost
ce814853c3 Icinga DB Check: don't check runtime update backlog during full sync 2022-06-28 15:35:34 +02:00
Julian Brost
0649a9dc06 Icinga DB Check: ignore suppressed queries in Redis backlog check
If some kind of query is not supposed to be processed at the moment, there is
little point in checking it. During a full dump, state updates are suppressed
(i.e. delayed), so when a dump takes very long, this would have resulted in a
false Redis backlog warning.
2022-06-28 15:35:34 +02:00
Julian Brost
9cfde09ea3 Icinga DB Check: include ongoing dumps in OK message
Also use the "current" and "full dump/sync" terminology in the other messages.
2022-06-28 15:35:34 +02:00
Julian Brost
679e13c686 Icinga DB Check: rename dump/sync related perfdata values
Scope all values using current/last instead of takes/took.
2022-06-28 15:35:34 +02:00
Julian Brost
a452d8c14d Icinga DB Check: add unit hints to all rates 2022-06-28 15:35:34 +02:00
Julian Brost
7593207c12 Icinga DB Check: update not connected message
The check makes no attempt to explicitly connect to Redis, it uses the
connection of the IcingaDB feature, so this message better describes the state
in this situation.
2022-06-28 15:35:34 +02:00
Julian Brost
899f5d1624 Icinga DB Check: fix race-condition with IcingaDB::Start()
IcingaDB::GetConnection() uses IcingaDB::m_Rcon which is only initialized in
IcingaDB::Start(), therefore add a nullptr check to the check command.
Additionally, as m_Rcon is potentially accessed concurrently, add a copy of the
value that is safe for concurrent use.
2022-06-28 15:35:34 +02:00
Julian Brost
7b16c85bc1 Icinga DB Check: remove markdown headings from output
icingadb-web shows multiple lines from the check output collapsed into a single
line. The lines containing just minuses make this look cluttered and making
making it a heading provides little to no benefit. Even when rendering markdown
in the check output at some point, having the lists labeled using normal
paragraphs would look just fine.
2022-06-28 15:35:34 +02:00
Julian Brost
6b6a70be80 Icinga DB Check: rename perfdata values
- Add icinga2_ and icingadb_ prefixes to make clear which component is
  responsible for the value.
- Rename heartbeat_lag to heartbeat_age, describes it better in my opinion and
  sound a bit less like something that should be as close to zero as possible.
- Rename redis_dump/database_sync into full_dump/full_sync as this is how these
  operations are refered to in log messages as well.
- Rename Redis backlog into Redis query backlog, makes it a bit clearer in my
  opinion.
- Rename runtime_backlog into runtime_update_backlog, as the component in
  Icinga DB is called that way and this naming is also exposed in log messages.
- Rename dump_config/state/history into config/state/history_dump, makes it
  sound more natural.
2022-06-28 15:35:34 +02:00
Julian Brost
81aef690d6 Icinga DB Check: rename variables from takes to duration
Sounds more natural in my opinion and I doubt that many users would get that
due to the difference between takes/took, this refers to ongoing dumps.
2022-06-28 15:35:34 +02:00
Julian Brost
782139995c Icinga DB Check: use more natural names for sync/cleanup metrics 2022-06-28 15:35:34 +02:00
Julian Brost
df1073b15c Icinga DB Check: report history and runtime update backlog separately
Probably makes little difference for an end-user, but for support and
development it's great to know which of the two is causing problems.
2022-06-28 15:35:34 +02:00
Julian Brost
ba67c102f3 Icinga DB Check: clearly state Icinga 2 Redis backlog
Should make it easier to understand that this refers to Redis queries issued by
Icinga 2.
2022-06-28 15:35:34 +02:00
Julian Brost
81feecf298 Icinga DB Check: replace nested calls to fmax() with std::max()
Improves readability, even more so after splitting it into separate lines.
2022-06-28 15:35:34 +02:00
Julian Brost
bb3ad133d0 Icinga DB Check: spell out "error" in perfdata 2022-06-28 15:35:34 +02:00
Julian Brost
3391a234b3 Icinga DB Check: fix error message on Redis query error
Not only XREAD queries are performed, so the previous error message was incorrect.
2022-06-28 15:35:34 +02:00
Julian Brost
153d5bae00 Icinga DB Check: remove unused includes 2022-06-28 15:35:34 +02:00
Julian Brost
2810350bc0 Icinga DB Check: rename keys in heartbeat stream
In both C++ and Go, the keys are only used as constant strings, so namespacing
them just adds clutter for the `general:*` keys, therefore remove it.
2022-06-28 15:35:34 +02:00
Julian Brost
dbc8995fc3 Icinga DB Check: remove *_1sec metrics
They add no additional information compared to the *_1min values as it's always
the same value divided by 60 anyways. Adding the actual value from the last
second makes little sense for realistic values of check_interval.
2022-06-28 15:35:34 +02:00
Julian Brost
437948c8f9 Icinga DB Check: read performance data string from Redis
Use the already existing format to pass performance data to Icinga 2 rather
than some new JSON structure. Has the additional benefit of doing more things
in Go than in C++.
2022-06-28 15:35:34 +02:00
Alexander A. Klimov
6eebc7868f Introduce Icinga DB check (like the IDO one) 2022-06-28 15:35:34 +02:00
Alexander A. Klimov
db249b1bde Remove Icinga DB perfdata from Icinga check
as the Icinga DB check already yields it.
2022-06-28 15:35:34 +02:00
Alexander A. Klimov
f9155a2d5f Introduce IcingaDB::AddKvsToMap() 2022-06-28 15:35:34 +02:00
Alexander A. Klimov
ce994d8135 RedisConnection::ReadRESP(): *-1\r\n is null, not [ ] 2022-06-28 15:35:34 +02:00
Alexander Aleksandrovič Klimov
323da4f06b
Merge pull request #9415 from Icinga/update-windows-openssl-version-213
Windows: Update openssl to the latest version 1_1_1p
2022-06-24 01:54:39 +02:00
Yonas Habteab
dcf06b1b6b Windows: Update openssl to the latest version 1_1_1p 2022-06-23 15:02:45 +02:00
Alexander Aleksandrovič Klimov
6bf16fe4f1
Merge pull request #9395 from Icinga/bugfix/atomic-members-2.13
Replace EventuallyAtomic with AtomicOrLocked which falls back to a mutex
2022-06-23 11:32:18 +02:00
Alexander Aleksandrovič Klimov
a46bd9f5cf
Merge pull request #9400 from Icinga/bugfix/remove-redundant-serialization-2.13
Remove redundant call to Serialize() in ConfigItem::Commit()
2022-06-23 11:31:54 +02:00
Alexander Aleksandrovič Klimov
9abc64e7d8
Merge pull request #9396 from Icinga/bugfix/icingadb-env-id-init-2.13
Icinga DB: initialize environment ID during config validation
2022-06-23 11:31:20 +02:00
Alexander Aleksandrovič Klimov
1d16c3a300
Merge pull request #9397 from Icinga/feature/parameter-delimiters-check-execution-6277-2.13
Introduce Command#arguments[].separator
2022-06-23 11:31:07 +02:00
Alexander Aleksandrovič Klimov
9eaa9c9f2e
Merge pull request #9398 from Icinga/bugfix/icingadb-command-arguments-null-2.13
IcingaDB: handle null (Empty) for value/set_if/separator in command arguments
2022-06-23 11:30:43 +02:00
Alexander Aleksandrovič Klimov
c5d66b5150
Merge pull request #9399 from Icinga/feature/add-name-suffix-to-columns-referring-to-name-2.13
IcingaDB: Add `_name` suffix to columns referring to name
2022-06-23 11:30:28 +02:00
Julian Brost
0ba703da13 Remove redundant call to Serialize() in ConfigItem::Commit()
The very same object is already serialized a few lines above, the result is
even stored in a variable, but that variable was not used before. Simply using
this variable results in a noticeable improvement of config validation times.
2022-06-15 10:57:03 +02:00
Yonas Habteab
524235872c Bump Redis schema version to 5 2022-06-14 15:07:02 +02:00
Yonas Habteab
7e12927b8a IcingaDB: Add _name suffix to columns referring to name 2022-06-14 15:07:02 +02:00
Alexander A. Klimov
20ae49ad49 Introduce Command#arguments[].separator
... for letting check commands produce argv like --key=value,
not just --key value.

refs #6277
2022-06-14 15:04:09 +02:00
Julian Brost
46c33bedaf IcingaDB: handle null (Empty) for value/set_if/separator in command arguments
Icinga 2 treats null (Empty) as if the corresponding attribute is not
specified. However, without this commit, it would serialize the value as "null"
(i.e. type string), so that it ends up in the database as this string instead
of NULL. This commit adds handling for ValueEmpty so that is serialized as JSON
null value and ends up in the database as NULL.
2022-06-14 14:55:19 +02:00
Julian Brost
b3d447fd49
Merge pull request #9360 from Icinga/feature/windows-boost-1.79-2.13
Windows: update boost to version 1.79.0
2022-06-14 14:27:39 +02:00
Julian Brost
7e93de2ec5
Merge pull request #9356 from Icinga/bugfix/suppressed-notifications-host-dependency-2.13
Take host state into account when sending suppressed notifications
2022-06-14 14:25:45 +02:00
Julian Brost
d28d18f75d Icinga DB: initialize environment ID during config validation
IcingaDB may receive callbacks from Boost signals before being fully started.
This resulted in situations where m_EnvironmentId was used before it was
initialized properly. This is fixed by initializing it earlier (during the
config validation stage). However, at this stage, it should not yet write to
disk, therefore, persisting the environment ID to disk is delayed until later
in the startup process.

Initializing at this stage has an extra benefit: if there is an error for some
reason (possibly corrupt icingadb.env file), this now shows up as a nice error
during config validation.

Additionally, this replaces the use of std::call_once with std::mutex due to
bug in libstdc++ (see inline comment for reference).
2022-06-14 14:09:48 +02:00
Julian Brost
184548f4fe Replace EventuallyAtomic with AtomicOrLocked which falls back to a mutex
Apparently there was a reason for making the members of generated classes
atomic. However, this was only done for some types, others were still accessed
using non-atomic operations. For members of type T::Ptr (i.e.  intrusive_ptr<T>),
this can result in a double free when multiple threads access the same variable
and at least one of them writes to the variable.

This commit makes use of std::atomic<T> for more T (it removes the additional
constraint sizeof(T) <= sizeof(void*)) and uses a type including a mutex for
load and store operations as a fallback.
2022-06-14 13:46:40 +02:00
Julian Brost
281aeb980b Windows: update boost to version 1.79.0 2022-04-27 13:46:18 +02:00
Julian Brost
d56afbc51a Take host state into account when sending suppressed notifications
Checkable::FireSuppressedNotifications() compares the time of the current
checkable with the last recovery time of parents to avoid notification right
after a parent recovered and before the current checkable was checked.

This commit makes this check also include to host if the checkable is a
service.  This makes the behavior consistent with the documentation that states
there is an implicit dependency on the host (which isn't realized as implicitly
generating a Dependency object unfortunately).
2022-04-22 12:04:46 +02:00