12887 Commits

Author SHA1 Message Date
Alexander A. Klimov
3b03050340 Place startup.log and status in /var/lib/icinga2/api, not /var/lib/icinga2/api/zones-stage
not to loose them.
2022-04-11 12:28:12 +02:00
Julian Brost
12293d999c
Merge pull request #9190 from Icinga/bugfix/sync-missing-history-information-213
Icinga DB: ensure consistent history streams in HA setup
2022-03-07 11:32:15 +01:00
Julian Brost
db84b834ca
Merge pull request #9214 from Icinga/feature/icingadb-add-previous_soft_state-to-host_state-and-service_state-9210-213
IcingaDB: Add previous_soft_state to host_state and service_state
2022-03-07 11:19:50 +01:00
Julian Brost
50ef32a0ad
Merge pull request #9228 from Icinga/bugfix/processcheckresult-dependency-deadlock-2.13
Prevent deadlock in ProcessCheckResult
2022-03-07 11:16:00 +01:00
Julian Brost
c6bac19da8
Merge pull request #9241 from Icinga/bugfix/icingadb-reachabilitychangehandler-9143
Icinga DB: ensure is_reachable and severity don't miss updates
2022-03-07 09:27:35 +01:00
Julian Brost
99e1b2efe2
Merge pull request #9240 from Icinga/bugfix/doc-allow-to-change-severity-formula-across-icinga2-releases
Doc: technical concepts: allow to change severity formula across Icin…
2022-03-07 09:23:36 +01:00
Julian Brost
c68ab0f3bc
Merge pull request #9242 from Icinga/bugfix/multi-ido-notification-id
IDO: fix incorrect contacts in notification history with multiple IDO instances on a single node
2022-03-07 09:22:27 +01:00
Julian Brost
53a389769c
Merge pull request #9260 from Icinga/bugfix/event-handler-spamming-8704-213
Checkable#ExecuteEventHandler(): don't outsource event command run twice
2022-02-25 16:52:27 +01:00
Alexander A. Klimov
74935dad7b Checkable#ExecuteEventHandler(): don't outsource event command run twice
refs #8704
2022-02-24 14:03:57 +01:00
Alexander A. Klimov
88b041c7c9 Checkable#ProcessCheckResult(): call Checkable::OnReachabilityChanged less often
Call it only on state changes to reduce no-op Redis/IDO updates a lot.

refs #9143
2022-02-23 16:06:31 +01:00
Alexander A. Klimov
4ea65076b0 Checkable#ProcessCheckResult(): call Checkable::OnReachabilityChanged last
to ensure Checkable#IsReachable() returns correctly for dependency children inside OnReachabilityChanged().
That needs the dependency parent to be already in the correct state.

refs #9143
2022-02-23 16:06:31 +01:00
Alexander A. Klimov
3c8c248508 Icinga DB: ensure is_reachable and severity don't miss updates
refs #9143
2022-02-23 16:06:31 +01:00
Julian Brost
ca37dbb9c6
Merge pull request #9252 from Icinga/bugfix/icingadb-state-history
Icinga DB: don't write state history for ack/downtime/host problem changes
2022-02-23 15:43:55 +01:00
Julian Brost
175fd2df44 Icinga DB: remove obsolete StateChangeHandler overload
This version of StateChangeHandler is no longer called anywhere as it was the
wrong function for all previous callers anyways.
2022-02-23 11:08:56 +01:00
Julian Brost
b60d3e5665 Icinga DB: make host problem change events update the state tables but not write state history
StateChangeHandler() is the function used when the actual hard/soft state
changes and thus also writes state history. This is not desired in this case,
instead, a runtime update should be generated, therefore call UpdateState()
instead.

refs #9063
2022-02-23 11:08:56 +01:00
Julian Brost
3466dacaac Icinga DB: make acknowledgement events update the state tables but not write state history
StateChangeHandler() is the function used when the actual hard/soft state
changes and thus also writes state history. This is not desired in this case,
instead, a runtime update should be generated, therefore call UpdateState()
instead.

refs #9063
2022-02-23 11:08:56 +01:00
Julian Brost
5ea0208b83 Icinga DB: make downtime events update the state tables but not write state history
StateChangeHandler() is the function used when the actual hard/soft state
changes and thus also writes state history. This is not desired in this case,
instead, a runtime update should be generated, therefore call UpdateState()
instead.

refs #9063
2022-02-23 11:08:56 +01:00
Julian Brost
f671374762 Icinga DB: don't reimplement volatile state update in SendConfigUpdate
Sending a volatile state update is already implemented in UpdateState, so just
use that function instead of generating the update queries.
2022-02-23 11:08:56 +01:00
Julian Brost
244575ecbd Icinga DB: Merge SendStatusUpdate into UpdateState
Previously, both funktions did related operations but had unclear and confusing
naming:
- UpdateState updated the icinga:{host,service}:state Redis keys.
- SendStatusUpdate sent a runtime update for the icinga:{host,service}:state.

This commit merges both functions into one with a new mode parameter. The
following modes are now supported:
- Volatile: Update the icinga:{host,service}:state Redis key.
- Full: Perform the volatile state update and in addition send a corresponding
  runtime update so that this state update gets written through to the
  persistent database by a running icingadb process.
- RuntimeOnly: Special mode for callers that can ensure that a volatile update
  for the current state was already performed but has to be upgraded to a full
  update.

refs #9063
2022-02-23 11:08:56 +01:00
Julian Brost
ed5ad46266 IDO: use per-instance notification_id in history
When there are multiple active IDO instances on the same node, before this
commit, all of them would share a single DbValue object for the notification_id
column of the icinga_contactnotifications table. This resulted in the issue
that one database references the notification_id in another database.

This commit fixes this by using a separate DbValue value for each IDO instance.
This needs a new signal as the existing OnQuery and OnMultipleQueries signals
perform the same queries on all IDO instances, but different queries are needed
here per instance (they only differ in the referenced DbValue). Therefore, a
new signal OnMakeQueries is added that takes a std::function which is called
once per IDO instance and can access callbacks to perform one or multiple
queries only on this specific IDO instance.
2022-02-21 15:51:04 +01:00
Alexander Aleksandrovič Klimov
d559b30f0a Doc: technical concepts: allow to change severity formula across Icinga 2 releases
so nobody is surprised in that case.
2022-02-21 15:35:51 +01:00
Alexander Aleksandrovič Klimov
40f647588e
Merge pull request #9233 from Icinga/bugfix/gha-pin-windows-version-2.13
GitHub Actions: pin Windows Server version to 2019
2022-02-21 15:08:18 +01:00
Alexander Aleksandrovič Klimov
d2c90ad66e
Merge pull request #9231 from Icinga/bugfix/gha-drop-centos8-2.13
GHA: drop CentOS 8
2022-02-21 14:04:42 +01:00
Julian Brost
c624c73274 GitHub Actions: pin Windows Server version to 2019 2022-02-18 16:09:20 +01:00
Alexander Aleksandrovič Klimov
3be3426238 GHA: drop CentOS 8
It's EOL.
2022-02-18 16:06:31 +01:00
Julian Brost
c55615a048 Prevent deadlock in ProcessCheckResult
Without this commit, children and parents of a checkable were rescheduled on a
state change while holding the lock for the current checkable. If both ends of
a dependency are checked at the same time and both change state, they could end
up in a deadlock waiting for each other.

This commit fixes this problem by changing the code so that other checkables
are rescheduled only after releasing the lock for the current checkable.
2022-02-18 14:21:59 +01:00
Julian Brost
3b15ae532c
Merge pull request #9217 from Icinga/feature/installation-instructions
Update installation instructions for easier navigation on icinga.com
2022-02-16 12:24:33 +01:00
Blerim Sheqa
659dfc0c52 Update installation instructions for easier navigation on icinga.com 2022-02-16 10:29:27 +01:00
Alexander A. Klimov
c613e62454 IcingaDB: Add previous_soft_state to host_state and service_state
refs #9210
2022-02-14 11:32:46 +01:00
Julian Brost
4c2f6faa61 Sync comment and downtime removal info for Icinga DB history
When a comment or downtime is removed manually, the name of the requestor and
timestamp have to be synced to other nodes in the cluster to allow all of them
to generate a consistent Icinga DB history stream.

refs #9101
2022-01-24 18:03:03 +01:00
Julian Brost
af94ed58dc
Merge pull request #9157 from Icinga/bugfix/downtime-trigger-time-2.13
Set downtime trigger time deterministically
2022-01-21 18:06:29 +01:00
Julian Brost
cd2ae9a886
Merge pull request #9182 from Icinga/bugfix/icinga-db-notification-history-might-use-incorrect-previous_hard_state-9132-213
IcingaDB#SendSentNotification(): make stream deterministic via CheckResult#previous_hard_state
2022-01-21 18:05:49 +01:00
Julian Brost
b11ac709d1
Merge pull request #9181 from Icinga/bugfix/icingadb-cmd-arg-order-int-213
Icinga DB: ensure icinga:*command:argument#order is an int
2022-01-21 18:05:28 +01:00
Julian Brost
4616804be7
Merge pull request #9158 from Icinga/bugfix/dont-trigger-fixed-downtime-as-flexible-2.13
Don't trigger a fixed downtime like a flexible one
2022-01-21 18:03:48 +01:00
Julian Brost
2741491ee8
Merge pull request #9159 from Icinga/bugfix/downtime-all-services-on-child-hosts-2.13
Fix scheduling of downtimes for all services on child hosts
2022-01-21 18:03:04 +01:00
Alexander A. Klimov
2e7fe4da95 IcingaDB#SendSentNotification(): make stream deterministic via CheckResult#previous_hard_state
Now it gets everything from one source, the CheckResult.

refs #9132
2022-01-20 11:27:19 +01:00
Alexander A. Klimov
50e3e31e04 Icinga DB: ensure icinga:*command:argument#order is an int
The config parser requires *Command#arguments#order to be a Number, i.e. 42,
4.2 or even "4.2". That's int-casted where needed, now also for Icinga DB.

Before:

```
object CheckCommand "9117" {
	command = [ "true" ]
	arguments = {
		"4.2" = { order = "4.2" }
	}
}
```

2022-01-03T13:25:07.166+0100	FATAL	icingadb	json: cannot unmarshal string into Go value of type int64
2022-01-20 11:17:22 +01:00
Julian Brost
28de8bd4ad
Merge pull request #9124 from Icinga/bugfix/icinga2-crashes-when-sending-notifications-8186
Avoid "type" key in dicts being part of object state attrs
2022-01-19 15:48:17 +01:00
Alexander Aleksandrovič Klimov
d416aa97ed
Merge pull request #9176 from Icinga/feature/github-actions-windows-preinstalled-deps-2.13
GitHub Actions: Use preinstalled dependencies on Windows (2.13)
2022-01-17 12:19:16 +01:00
Julian Brost
9aca722f5e GitHub Actions: Use preinstalled dependencies on Windows
The Windows image provided by GitHub already includes most of our dependencies,
so the installation of all Chocolatey packages except winflexbison3 was
redundant. Visual Studio is provided in the Enterprise version instead of
Community, so that has to be added to the search path as well.
2022-01-14 14:04:19 +01:00
Alexander Aleksandrovič Klimov
1f0f174df1
Merge pull request #9169 from Icinga/bugfix/gha-windows-throwonnativefailure-2.13
doc/win-dev.ps1: actually utilize ThrowOnNativeFailure
2022-01-10 17:55:06 +01:00
Alexander A. Klimov
7fc5dcf6dc doc/win-dev.ps1: actually utilize ThrowOnNativeFailure
refs #8935
2022-01-10 14:28:47 +01:00
Julian Brost
f9e371e109
Merge pull request #9139 from Icinga/bugfix/mysql-schema-versions-2.13
Make MySQL schema version in full schema file and upgrade files consistent (2.13)
2022-01-10 09:54:50 +01:00
Julian Brost
0a93beaa29
Merge pull request #9164 from Icinga/feature/gha2133
Update GHA
2022-01-05 18:30:05 +01:00
Julian Brost
2d7b9acc88
Merge pull request #9155 from Icinga/bugfix/git-describe-escapes-to-parent-dirs-2.13
third-party: update GetGitRevisionDescription CMake module
2022-01-05 18:11:44 +01:00
Alexander Aleksandrovič Klimov
d0b0256fc0 GHA: drop SUSE 15.2 and add 15.3 2022-01-05 13:15:01 +01:00
Alexander Aleksandrovič Klimov
bd6752161d GHA: Add Ubuntu impish 2022-01-05 13:15:01 +01:00
Alexander Aleksandrovič Klimov
fb31d0f7d8 GHA: add Raspbian bullseye 2022-01-05 13:15:01 +01:00
Alexander Aleksandrovič Klimov
025aad890f Put -latomic to the other -ls
to make it compiling on Raspberry Pi OS bullseye.
2022-01-05 13:15:01 +01:00
Alexander A. Klimov
c5c2d20995 GHA: Raspbian: install more recent QEMU
to workaround "semop(1): encountered an error: Function not implemented".
2022-01-05 13:15:01 +01:00