14292 Commits

Author SHA1 Message Date
Yonas Habteab
953a2e2e96 Merge {host,service}::StateTypeToString() & drop unused StateTypeFromString() 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
215af2b580
Merge pull request #10468 from Icinga/gha-fix-rockylinux-compression-libs
GHA: Fix rockylinux:9 by install compression libs
2025-06-06 13:15:13 +02:00
Alvar Penning
1f4b0bdd46
GHA: Fix rockylinux:9 by install compression libs
Since recently, rockylinux:9 failed with linker errors against bz2, lzma
and zstd. Installing the relevant devel packages fixed the builds.

For reasons, cmake has started to add the -lbz2, -llzma, and -lzstd
linker flags. Since Icinga 2 usually does not need those, the relevant
devel packages were not installed. This may be due to some other
transitively linked dependency.

> 2025-06-05T13:12:59.5866282Z : && /usr/lib64/ccache/c++ -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=x86-64-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -Wsuggest-override -Wrange-loop-construct -g -pthread -Winvalid-pch -O2 -g -DNDEBUG -Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1   -Wl,--export-dynamic -rdynamic third-party/mmatch/CMakeFiles/mmatch.dir/mmatch.c.o third-party/socketpair/CMakeFiles/socketpair.dir/socketpair.c.o lib/base/CMakeFiles/base.dir/application-version.cpp.o lib/base/CMakeFiles/base.dir/journaldlogger.cpp.o lib/base/CMakeFiles/base.dir/base_unity.cpp.o third-party/execvpe/CMakeFiles/execvpe.dir/execvpe.c.o lib/config/CMakeFiles/config.dir/config_lexer.cc.o lib/config/CMakeFiles/config.dir/config_parser.cc.o lib/config/CMakeFiles/config.dir/config_unity.cpp.o lib/remote/CMakeFiles/remote.dir/remote_unity.cpp.o plugins/CMakeFiles/check_nscp_api.dir/check_nscp_api.cpp.o -o Bin/RelWithDebInfo/check_nscp_api  -Wl,-rpath,::::::::::::::::::::::::  -ldl  /usr/lib64/libboost_coroutine.so.1.75.0  /usr/lib64/libboost_context.so.1.75.0  /usr/lib64/libboost_date_time.so.1.75.0  /usr/lib64/libboost_filesystem.so.1.75.0  /usr/lib64/libboost_iostreams.so.1.75.0  /usr/lib64/libboost_thread.so.1.75.0  /usr/lib64/libboost_system.so.1.75.0  /usr/lib64/libboost_program_options.so.1.75.0  /usr/lib64/libboost_regex.so.1.75.0  /usr/lib64/libssl.so  /usr/lib64/libcrypto.so  -lsystemd  /lib64/libedit.so  -ltermcap  /usr/lib64/libboost_chrono.so.1.75.0  -lbz2  -llzma  -lz  -lzstd  -licudata  -licui18n  -licuuc && :
> 2025-06-05T13:12:59.5872347Z /usr/bin/ld: cannot find -lbz2
> 2025-06-05T13:12:59.5872577Z /usr/bin/ld: cannot find -llzma
> 2025-06-05T13:12:59.5872802Z /usr/bin/ld: cannot find -lzstd
> 2025-06-05T13:12:59.5873039Z collect2: error: ld returned 1 exit status

Hopefully, this issue may resolve itself in the near future, but for the
time being this satisfies our CI run on Rocky Linux 9.
2025-06-06 11:04:01 +02:00
Yonas Habteab
bc5db9834f Drop System#track_parents DSL function
No external user needs to manipulate the actual object dependency
graphs. This was maybe introduced for debugging purposes at that time
but if someone messes with this in prod - good luck with that. Oh, apart
from that it's broken :( and doesn't track parents as its implies but
children.
2025-06-03 17:09:57 +02:00
Yonas Habteab
9577af8e6d Drop Checkable#process_check_result() DSL function
Not sure why it's introduced in the first place, maybe for debugging
purposes at the early stage of Icinga 2 dev but I failed to see an
actual useful use case for it that's worth its maintenance burden. So,
this commit dropped it entirely from the DSL language.
2025-06-03 17:09:57 +02:00
Yannick Martin
e6fc1b91a7
AddComment: return Comment::Ptr instead of String containing the name
Mimic 88e5744d54f79ab6a84260bd4a8d2cc0ffd43465 and address nullptr on concurrent
  add-comment / remove-comment actions.
2025-06-03 17:00:07 +02:00
Yonas Habteab
bcf43208c6
Merge pull request #10463 from Icinga/drop-ubuntu
Drop Ubuntu 20.04
2025-06-03 16:46:39 +02:00
Yonas Habteab
dd58fd0cde Drop Ubuntu 20.04
Is EOL by the end of May (31).
2025-06-03 11:18:05 +02:00
Yonas Habteab
3d04eb456a
Merge pull request #10415 from Icinga/abort-no-endpoint-conns
Abort connections with no valid endpoint
2025-06-02 16:21:46 +02:00
William Calliari
85ddb87c41
Fix Author 2025-05-29 09:16:46 +02:00
William Calliari
a2c84398b7
Add name to AUTHORS 2025-05-29 09:16:46 +02:00
William Calliari
9d40de78eb
Address comments from review 2025-05-29 09:16:46 +02:00
William Calliari
abf2fb392b
Keep object locked until events are dispatched. 2025-05-29 09:16: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
Yonas Habteab
23ecc98812
Merge pull request #10419 from Icinga/fix-boost-1880-build-errors
Support Boost `1.88` on Windows
2025-05-28 11:56:20 +02:00
Yonas Habteab
c4ddd4886b Bump Boost shipped for Windows to v1.88 2025-05-28 09:39:15 +02:00
Yonas Habteab
7d2f1c2030 Drop Windows VISTA from the supported platform
Boost `1.88.0` introduced a feature [^1] that makes use of the Windows API, but it
uses API functions that are only available with `PSAPI_VERSION >= 2` and
Windows VISTA only supports `PSAPI_VERSION == 1`. Actually, that new feature
can also be disabled by setting the `BOOST_STACKTRACE_DISABLE_OFFSET_ADDR_BASE`
macro, but since it seems to be a useful feature and isn't even disabled by default,
we can just drop it that ancient Windows version instead of disabling it.

[^1]: https://github.com/boostorg/stacktrace/pull/200
2025-05-28 09:39:03 +02:00
Yonas Habteab
d265329a17
Merge commit from fork
Fix for master
2025-05-27 13:50:26 +02:00
Yannick Martin
ab58ff2928
fix api deadlock that can appears on two simultaneous actions
With this mutex, we can have deadlock in the following case:
    1/ Thread A processes a /v1/actions/acknowledge-problem request and locks the checkable
    2/ Thread B processes a /v1/actions/add-comment and enters first the ConfigItem::ActivateItems() method and locks the static mutex there and starts the just created comment object, which triggers the OnCommentAdded() event.
    3/ Thread A wants to activate the just created ack comment as well but since the mutex is already locked by TB, it blocks.
    4/ Thread B's OnCommentAdded() even dispatch causes the IcingaDB::CommentAddedHandler() to be called and implicitly triggers full state update for the checkable. Now, the state serialization of that checkable (remember that's the same checkable currently locked by TA) also includes computing its severity, thus it calls either service->GetSeverity() or host->GetSeverity(). However, since computing the checkable severity (as of now) requires acquiring the object lock, and boom - they deadlock each other.
2025-05-26 15:05:42 +02:00
Alexander Aleksandrovič Klimov
56d9f38b35
Merge pull request #10456 from Icinga/SharedObject-delete
SharedObject: delete unused methods
2025-05-26 10:00:52 +02:00
Yonas Habteab
b1e08ba7a9 docs: document the new object distribution behavior 2025-05-23 17:24:05 +02:00
Alexander A. Klimov
4f351f625f SharedObject: delete unused methods
None of the derived classes use them, none shall have to explicitly delete them.
2025-05-23 15:47:02 +02:00
Alexander A. Klimov
36743f3100 Checkable#ProcessCheckResult(): discard CR or delay its producers shutdown 2025-05-23 14:53:58 +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
Alexander A. Klimov
c7cca7b460 Add a StoppableWaitGroup, and join it on #Stop(), to:
ApiListener
CheckerComponent
ExternalCommandListener
LivestatusListener
2025-05-23 14:53:58 +02:00
Alexander A. Klimov
18fb93fc11 Introduce WaitGroup and StoppableWaitGroup 2025-05-23 14:53:58 +02:00
Alexander A. Klimov
77b86bba52 Move l_MyCapabilities -> ApiCapabilities::MyCapabilities 2025-05-23 10:44:16 +02:00
Alexander A. Klimov
6cd83ba2b8 ApiListener::UpdateObjectAuthority(): distribute auth. by object's host
Pin child objects of hosts (HOST!...) to the same endpoint as the host.
This reduces cross-object action latency withing the same host.
If all endpoints know this algorithm, we can use it.
2025-05-23 10:44:16 +02:00
Yonas Habteab
2b0f73987e
Merge pull request #10443 from Icinga/use-correct-timeout-for-command-endpoints
Checkable: Use correct timeout for rescheduling remote checks
2025-05-23 10:14:49 +02:00
Alexander A. Klimov
18f810a1ea For the same zone, call ApiListener::UpdateObjectAuthority() in icinga::Hello
after setting remote capabilities. They'll become important for teamwork in a zone.
2025-05-22 15:01:06 +02:00
Alexander Aleksandrovič Klimov
ec2080dcc1
Merge pull request #9731 from Icinga/fix-compiler-warnings-by-copy-constructing-loop-variables-explicitly
Fix compiler warnings by (copy-)constructing loop variables explicitly or not at all
2025-05-21 14:26:47 +02:00
Alexander A. Klimov
78ded7423f Always compile with -Wrange-loop-construct
This enables warnings when range-based for-loops unnecessarily make copies of elements instead of binding them by reference.
2025-05-21 12:04:24 +02:00
Alexander A. Klimov
22e75f08fa Fix compiler warnings by not unnecessarily (copy-)constructing loop variables 2025-05-21 11:36:32 +02:00
Julian Brost
4023128be4 VerifyCertificate: Work around issue in OpenSSL < 1.1.0 causing invalid certifcates being treated as valid
Old versions of OpenSSL stored a valid flag in the certificate (see inline code
comment for details) that if already set, causes parts of the verification to
be skipped and return that the certificate is valid, even if it's not actually
signed by the CA in the trust store.

This issue was assigned CVE-2025-48057.
2025-05-21 10:50:12 +02:00
Julian Brost
00864d1096 VerifyCertificate: fix use after free
`X509_STORE_CTX_get_error(csc)` was called after `X509_STORE_CTX_free(csc)`.
This is fixed by automatically freeing variables at the end of the function
using `std::unique_ptr`.
2025-05-21 10:46:25 +02:00
Yonas Habteab
31b5d36975
Merge pull request #10445 from Icinga/bump-openssl
Bump Windows OpenSSL version to `3.0.16`
2025-05-20 16:08:12 +02:00
Yonas Habteab
ae6ffcf48a
Merge pull request #10446 from Icinga/Al2Klimov-patch-7
19-technical-concepts.md: correct cold startup duration
2025-05-20 15:04:39 +02:00
Alexander Aleksandrovič Klimov
5c20b1ae12
Merge pull request #10444 from Icinga/ProcessingResult-NoCheckResult
Remove unused ProcessingResult::NoCheckResult
2025-05-20 12:54:41 +02:00
Alexander Aleksandrovič Klimov
5e23a4f098
19-technical-concepts.md: correct cold startup duration
It's 30s since 149f640fd8e9191efcf69a60e8ce83f38101d359.
2025-05-20 12:44:04 +02:00
Yonas Habteab
828f18f650 Bump Windows OpenSSL version to 3.0.16 2025-05-20 12:14:56 +02:00
Alexander A. Klimov
69d2a0442a Remove unused ProcessingResult::NoCheckResult
No one passes a NULL CR to Checkable#ProcessCheckResult() anymore.
2025-05-20 10:41:26 +02:00
Alexander A. Klimov
55fc0e51ff Checkable#process_check_result(): don't pass NULL CR to Checkable#ProcessCheckResult()
It's ignored anyway.
2025-05-20 10:33:20 +02:00
Yonas Habteab
44b3382f5f
Merge pull request #10442 from Icinga/jschmidt/fix-compiler-warnings
Fix two low-hanging fruit compiler warnings
2025-05-19 14:40:55 +02:00
Yonas Habteab
0c2215a9f8 Checkable: Use correct timeout for rescheduling remote checks
Previously, the `command#timeout` which by default is `1m`, was used to reschedule
the just sent remote check. However, this results into a bunch of extra checks being
sent to the remote host, even though the first one is still running. That's because
if one want to override the default timeout of the command for a specific host/service,
one has to set the `checkable#check_timeout` attribute to the desired value. So, this
commit makes sure that the `checkable#check_timeout` attribute (if set) is used to
reschedule the remote check.
2025-05-19 14:07:33 +02:00
Johannes Schmidt
f8d3bacc29 Fix warnings related to enum integer conversion 2025-05-19 12:31:22 +02:00
Yonas Habteab
8a1d9df767
Merge pull request #10070 from Icinga/time-period-schedule-next-check-on-next-transition-9984
If skipped due to time period, schedule next check on next transition
2025-05-19 12:29:09 +02:00
Johannes Schmidt
6a6c494279 Mark MakeName and ParseName virtual methods as override 2025-05-19 11:33:22 +02:00
Yonas Habteab
be0ddb158f
Merge pull request #10441 from Icinga/Al2Klimov-patch-7
Markdown: indent 2nd-level <ul> with 4 spaces, not 1
2025-05-16 15:11:43 +02:00
Julian Brost
d1623b5391
Merge pull request #10435 from SpeedD3/itl/vmware.esx/maintenance_mode_state
ITL: add argument maintenance_mode_state to vmware_esx
2025-05-16 15:01:06 +02:00