Yonas Habteab
91c7e60df8
Replace all existing copyright headers with SPDX headers
...
I've used the following command to replace the original copyright header
lines in a C-style comment block:
```
$ find . \( -type d \( -name '\..*' -o -name third-party -o -name scripts -o -name prefix -o -name malloc -o -name server -o -name docker -o -name build -o -name doc \) -prune \) -o -type f -exec perl -pi -e 's{/\*[^*]*\(\s*c\s*\)\s*(\d{4})\s*Icinga\s+GmbH[^*]*\*/}{// SPDX-FileCopyrightText: \1 Icinga GmbH <https://icinga.com >\n// SPDX-License-Identifier: GPL-2.0-or-later}gi' {} +
```
For files that use shell-style comments (#) like CMakeLists.txt, I've
used this command:
```
$ find . \( -type d \( -name '\..*' -o -name third-party -o -name scripts -o -name prefix -o -name malloc -o -name server -o -name docker -o -name build -o -name doc \) -prune \) -o -type f -exec perl -pi -e 's{#.*\(\s*c\s*\)\s(\d{4})\sIcinga\s+GmbH.*}{# SPDX-FileCopyrightText: \1 Icinga GmbH <https://icinga.com >\n# SPDX-License-Identifier: GPL-2.0-or-later}gi' {} +
```
And for SQL files:
```
$ find . \( -type d \( -name '\..*' -o -name third-party -o -name scripts -o -name prefix -o -name malloc -o -name server -o -name docker -o -name build -o -name doc \) -prune \) -o -type f \( -name '*.sql' \) -exec perl -pi -e 's{--.*\(c\)\s(\d{4})\sIcinga\sGmbH.*}{-- SPDX-FileCopyrightText: \1 Icinga GmbH <https://icinga.com >\n-- SPDX-License-Identifier: GPL-2.0-or-later}gi' {} +
$ find . \( -type d \( -name '\..*' -o -name third-party -o -name scripts -o -name prefix -o -name malloc -o -name server -o -name docker -o -name build -o -name doc \) -prune \) -o -type f \( -name '*.sql' \) -exec perl -pi -e 's{-- Copyright \(c\)\s(\d{4})\sIcinga\s+Development\sTeam.*}{-- SPDX-FileCopyrightText: \1 Icinga GmbH <https://icinga.com >\n-- SPDX-License-Identifier: GPL-2.0-or-later}gi' {} +
```
2026-02-04 14:00:05 +01:00
Alexander A. Klimov
4ba46f9eb2
Silence compiler warnings about unused parameters
...
Every of these parameters exists for a reason.
The best we can do is to convince the compiler.
2026-01-23 13:31:01 +01:00
Johannes Schmidt
11e83b6274
Fix -Wunused-lambda-capture warning
2025-11-19 12:00:58 +01:00
Johannes Schmidt
93e69ed0e8
Fix -Wsign-compare warnings
2025-11-19 12:00:58 +01:00
Johannes Schmidt
f42510f981
Merge pull request #9411 from Icinga/compiler-warnings
...
Container Image / Container Image (push) Has been cancelled
Linux / alpine:bash (push) Has been cancelled
Linux / amazonlinux:2 (push) Has been cancelled
Linux / amazonlinux:2023 (push) Has been cancelled
Linux / debian:11 (linux/386) (push) Has been cancelled
Linux / debian:11 (push) Has been cancelled
Linux / debian:12 (linux/386) (push) Has been cancelled
Linux / debian:12 (push) Has been cancelled
Linux / debian:13 (push) Has been cancelled
Linux / fedora:41 (push) Has been cancelled
Linux / fedora:42 (push) Has been cancelled
Linux / opensuse/leap:15.6 (push) Has been cancelled
Linux / opensuse/leap:16.0 (push) Has been cancelled
Linux / registry.suse.com/suse/sle15:15.6 (push) Has been cancelled
Linux / registry.suse.com/suse/sle15:15.7 (push) Has been cancelled
Linux / rockylinux/rockylinux:10 (push) Has been cancelled
Linux / rockylinux:8 (push) Has been cancelled
Linux / rockylinux:9 (push) Has been cancelled
Linux / ubuntu:22.04 (push) Has been cancelled
Linux / ubuntu:24.04 (push) Has been cancelled
Linux / ubuntu:25.04 (push) Has been cancelled
Windows / Windows (push) Has been cancelled
Fix compiler warnings
2025-10-21 15:23:31 +02:00
Alexander A. Klimov
d877e818db
Fix compiler warnings
2025-10-17 17:08:31 +02:00
Alexander A. Klimov
37b5c39e20
Fix compiler warnings by re-ordering member init in constructors
2025-10-17 15:33:57 +02:00
Alexander A. Klimov
3d69a31043
Fix compiler warnings by removing unused variables
2025-10-17 09:56:46 +02:00
Julian Brost
b27310fb6c
Merge pull request #10467 from Icinga/icingadb-calceventid-no-double-timestamptomilliseconds
...
IcingaDB::CalcEventID: No milliseconds as eventTime
2025-06-10 17:09:16 +02:00
Alvar Penning
9cdbbf4ede
IcingaDB::CalcEventID: No milliseconds as eventTime
...
CalcEventID's internal logic uses the TimestampToMilliseconds function
to convert the given eventTime to milliseconds. Within this function,
the timestamp is capped to prevent an overflow.
On three occasions, the input timestamp given to CalcEventID had already
been converted using TimestampToMilliseconds. The second
TimestampToMilliseconds function then checked the value and always
returned the capped maximum value. Consequently, CalcEventID returned
the same hash value for different timestamps.
This affected SendFlappingChange, SendAcknowledgementSet, and
SendAcknowledgementCleared. For example, when two acknowledgments were
created for the same service, the calculated event_id representing the
history table row would be identical.
Fixes #10465
2025-06-06 16:50:01 +02:00
Yonas Habteab
9e65a8b63b
Fix compiler warnings of missing NotificationTypeAll case
2025-06-06 13:31:44 +02:00
Yonas Habteab
fd1927115a
IcingaDB: Make is_acknowledged a bool & add is_sticky_acknowledgement field
2025-06-06 13:31:44 +02:00
Yonas Habteab
76d5915b3f
IcingaDB: Set notification_histor#type to its string representation
...
So that Icinga DB (Go) daemon doesn't have to make the mappings again.
2025-06-06 13:31:44 +02:00
Yonas Habteab
7037b18b34
IcingaDB: Send the int representation of states & types filter
2025-06-06 13:31:44 +02:00
Yonas Habteab
ef1c0eb9b3
IcingaDB: Set state_type to hard or soft and not int
2025-06-06 13:31:44 +02:00
Yonas Habteab
5d11df1abf
IcingaDB: Send the string representation of comment#entry_type to Redis
2025-06-06 13:31:44 +02:00
Julian Brost
c253e7eb6e
Merge pull request #10397 from Icinga/activation-priority-10179
...
Checkable#ProcessCheckResult(): discard🗑️ CR or delay its producers shutdown
2025-05-28 12:30:40 +02:00
Alexander A. Klimov
f4691dd054
Require to pass WaitGroup::Ptr to several methods
...
Namely:
Checkable#ProcessCheckResult()
ClusterCheckTask::ScriptFunc()
ClusterZoneCheckTask::ScriptFunc()
DummyCheckTask::ScriptFunc()
ExceptionCheckTask::ScriptFunc()
IcingaCheckTask::ScriptFunc()
IfwApiCheckTask::ScriptFunc()
NullCheckTask::ScriptFunc()
PluginCheckTask::ScriptFunc()
RandomCheckTask::ScriptFunc()
SleepCheckTask::ScriptFunc()
IdoCheckTask::ScriptFunc()
IcingadbCheck::ScriptFunc()
CheckCommand#Execute()
Checkable#ExecuteCheck()
ClusterEvents::ExecuteCheckFromQueue()
ExternalCommandProcessor::Process*CheckResult()
ExternalCommandCallback
ExternalCommandProcessor::Execute()
ExternalCommandProcessor::ExecuteFromFile()
ExternalCommandProcessor::ProcessFile()
LivestatusQuery#ExecuteCommandHelper()
LivestatusQuery#Execute()
2025-05-23 14:53:58 +02:00
Johannes Schmidt
f8d3bacc29
Fix warnings related to enum integer conversion
2025-05-19 12:31:22 +02:00
Yonas Habteab
7acec6fc36
IcingaDB: Set downtime cancel_time conditionally
...
If the downtime ended automatically `cancel_time` should just be `NULL`
instead of a `0` timestamp.
2025-05-16 09:49:58 +02:00
Yonas Habteab
5ea666a7ad
IcingaDB: Don't set cancel_time for downtime start event
...
It's a downtime start event there's now way the downtime could be
cancelled before it even started.
2025-05-16 09:49:16 +02:00
Alexander A. Klimov
2739f7f189
RedisConnection#Connect(): get rid of spin lock
...
Instead of IoEngine::YieldCurrentCoroutine(yc) until m_Queues.FutureResponseActions.empty(), async-wait a CV which is updated along with m_Queues.FutureResponseActions.
2025-05-14 12:28:11 +02:00
Alexander A. Klimov
331ba1f661
Rename AsioConditionVariable to AsioEvent
...
The current implementation is rather similar to Python's threading.Event, than to a CV.
2025-04-29 11:39:42 +02:00
Alexander A. Klimov
0662f2b719
In a coroutine, re-throw everything ex. std::exception (and inheritors)
...
not just boost::coroutines::detail::forced_unwind.
This is needed because as of Boost 1.87, boost::asio::spawn() uses Fiber, not Coroutine v1.
https://github.com/boostorg/asio/commit/df973a85ed69f021
This is safe because every actual exception shall inherit from std::exception. Except forced_unwind and its Fiber equivalent, so that `catch(const std::exception&)` doesn't catch them and only them.
2025-04-14 17:30:19 +02:00
Yonas Habteab
bc2c750551
IcingaDB: Don't stream runtime state updates to Redis
2025-03-26 10:48:37 +01:00
Julian Brost
065118bc22
Make DependencyGroup::State an enum
...
The previous struct used two bools to represent three useful states. Make this
more explicit by having these three states as an enum.
2025-03-19 16:28:00 +01:00
Yonas Habteab
945a79e37f
IcingaDB: Don't send useless dependencies state updates
2025-03-19 16:28:00 +01:00
Yonas Habteab
da637c3741
IcingaDB: Always send dependencies state HSET updates to Redis
2025-03-19 16:28:00 +01:00
Yonas Habteab
7fbb8f7452
Evaluate dependency group state only for a specific child
...
Previously the dependency state was evaluated by picking the first
dependency object from the batched members. However, since the
dependency `disable_{checks,notifications` attributes aren't taken into
account when batching the members, the evaluated state may yield a wrong
result for some Checkables due to some random dependency from other
Checkable of that group that has the `disable_{checks,notifications`
attrs set. This commit forces the callers to always provide the child
Checkable the state is evaluated for and picks only the dependency
objects of that child Checkable.
2025-03-19 16:28:00 +01:00
Yonas Habteab
0ab50fd82d
IcingaDB: Process dependencies runtime updates
2025-03-19 16:28:00 +01:00
Yonas Habteab
aed1bb6294
IcingaDB: Introduce ExecuteRedisTransaction() helper method
2025-03-19 16:28:00 +01:00
Yonas Habteab
db3f8dec27
IcingaDB: Sync dependencies initial states on config dump
2025-03-19 16:28:00 +01:00
Yonas Habteab
f502993eb4
IcingaDB: Sync dependencies states to Redis
2025-03-19 16:28:00 +01:00
Yonas Habteab
c6466ee0ea
IcingaDB: Dump checkables dependencies config to redis correctly
2025-03-19 15:28:31 +01:00
Yonas Habteab
4bfaefadfa
IcingaDB: Bump expected redis version to 6
2025-03-12 16:32:01 +01:00
Yonas Habteab
c02b9d74a9
IcingaDB: Send reachablity state updates for all children
2025-03-12 16:19:22 +01:00
Yonas Habteab
6321606671
IcingaDB: Sync affects_children as part of runtime state updates
2025-03-12 16:19:22 +01:00
Yonas Habteab
297b62d841
IcingaDB: Add affected_children to Host/Service Redis updates
2025-03-12 16:19:22 +01:00
Alvar Penning
ef93f945a2
IcingaDB: Start keeping track of Host/Service to Dependency relationship
...
This does not work in this state!
Trying to refresh Dependency if a Host or Service being member
of this Dependency has a state change.
2025-03-12 16:19:22 +01:00
Yonas Habteab
6ca0611f3d
IcingaDB: Don't publish useless data to Redis
...
The Icinga DB daemon processes the data from the `IcingaApplication`
type only and Icinga DB Web also uses only those stats. However, before
this commit, Icinga DB published all kinds of useless stats to Redis
each second, like the number of (un)reachable hosts, services, and so
on, which is waste of CPU and some other resources. This commit reduces
the published data drastically to only those simple stats coming from
the `IcingaApplication` type.
2025-03-04 17:34:38 +01:00
Julian Brost
4ffe88e263
Merge pull request #9732 from Icinga/silence-compiler-warnings-in-code-we-don-t-maintain
...
Silence compiler warnings in code we don't maintain
2025-01-15 16:33:24 +01:00
Alexander A. Klimov
6195a457a7
Silence compiler warnings in code we don't maintain
2025-01-14 11:48:33 +01:00
Julian Brost
fb50e4b1f1
Merge pull request #10188 from Icinga/icingadb-heartbeat-both-responsible
...
IcingaDB Check: Multiple Responsible Instances
2025-01-13 11:56:19 +01:00
Alexander A. Klimov
27e0e236cb
Move Timeout instances from heap to stack
2025-01-07 18:20:50 +01:00
Alexander A. Klimov
d77d7506f1
Don't call Timeout#Cancel() where Timeout#~Timeout() is called
2025-01-07 18:20:14 +01:00
Alexander A. Klimov
cb51649363
Timeout#Timeout(): drop unnecessary template parameters
2025-01-07 18:19:39 +01:00
Alexander A. Klimov
d2285bcf0e
While using Timeout, don't unnecessarily keep the strand alive via smart pointer
2025-01-07 18:18:46 +01:00
Alexander A. Klimov
92ab913226
Timeout#Timeout(): don't pass yield_context to callback
...
It's not used. Also, the callback shall run completely at once. This ensures that it won't (continue to) run once another coroutine on the strand calls Timeout#Cancel().
2025-01-07 18:18:18 +01:00
Alvar Penning
0bbe7a9b2f
IcingaDB Check: Multiple Responsible Instances
...
By design, only one Icinga 2 instance should be responsible in the HA
context. If this promise is broken, the Icinga 2 IcingaDB check should
report it.
The code did not check for invalid data in icingadb:telemetry:heartbeat.
With this change, it will go CRITICAL with a descriptive message and
report the actual number of icingadb_responsible_instances in the
performance data.
2024-11-15 12:56:45 +01:00
Julian Brost
67175c43c0
Merge pull request #10102 from Icinga/icingadb-redis-username
...
Icinga DB: Config no_user_modify and Support Redis username authentication
2024-11-12 17:04:20 +01:00