Commit Graph

13963 Commits

Author SHA1 Message Date
Yonas Habteab 41373ad0e5 Log before & after an RPC client is disconnected 2025-01-08 16:30:36 +01:00
Yonas Habteab 3af7cfe2ec JsonRpcConnection: Don't drop client from cache prematurely
PR #7445 incorrectly assumed that a peer that had already disconnected
and never reconnected was due to the endpoint client being dropped after
a successful socket shutdown. However, the issue at that time was that
there was not a single timeout guards that could cancel the `async_shutdown`
call, petentially blocking indefinetely. Although removing the client from
cache early might have allowed the endpoint to reconnect, it did not
resolve the underlying problem. Now that we have a proper cancellation
timeout, we can wait until the currently used socket is fully closed
before dropping the client from our cache. When our socket termination
works reliably, the `ApiListener` reconnect timer should attempt to
reconnect this endpoint after the next tick. Additionally, we now have
logs both for before and after socket termination, which may help
identify if it is hanging somewhere in between.
2025-01-08 16:30:36 +01:00
Julian Brost fba56f0e61
Merge pull request #10254 from Icinga/Timeout-Cancel
Timeout: use less resources, clean them up better and make cancellation deterministic
2025-01-08 16:28:54 +01:00
Alexander Aleksandrovič Klimov 9bc9d14e7e
Merge pull request #10283 from Icinga/itl-check_ssh-remote-pr9923
Update ITL for check_ssh
2025-01-08 12:22:44 +01:00
Alexander Aleksandrovič Klimov d4b0e08c80
Merge pull request #10281 from Icinga/gha-sles
GHA: also test SLES, not just openSUSE
2025-01-08 12:04:01 +01:00
Peter Eckel 920ba0b2db
Added the `--dane` option to the command definition ssl_cert (#10196) 2025-01-08 10:47:37 +00:00
MarcusCaepio a662cb1a6b
Update ITL for check_ssh
Adds parameters for check_ssh (-r and -P) based on
nagios-plugins 2.3.3 / monitoring-plugins 2.3
Fixes #9922
2025-01-08 10:31:25 +01:00
alvar c5963712fa
Merge pull request #10261 from n-rodriguez/wip/unplugged_nics_state
ITL vmware-esx-soap-host-net{,-nic}: Add missing option "--unplugged_nics_state"
2025-01-08 09:03:33 +00:00
Alexander A. Klimov 8f72891228 Document Timeout 2025-01-07 18:20:54 +01:00
Alexander A. Klimov 3ca7ff7bf4 Timeout: explicitly delete #Timeout(const Timeout&), #Timeout(Timeout&&), #operator=(const Timeout&), #operator=(Timeout&&) 2025-01-07 18:20:52 +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 959b162913 Timeout#~Timeout(), #Cancel(): support boost::asio::io_context running on multiple threads 2025-01-07 18:19:42 +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 8cdbea303b Test Timeout 2025-01-07 18:18:39 +01:00
Alexander A. Klimov faaeb4eb2e Timeout: use a plain callback, not an unnecessary coroutine 2025-01-07 18:18:24 +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
Julian Brost 880632b93a
Merge pull request #9861 from ymartin-ovh/issue-9752
icinga2: address comment loading where host reference is not found
2025-01-07 14:12:03 +01:00
Julian Brost 9a000f3d45
Merge pull request #10000 from Icinga/broken-downtime-comment-sync
Fix broken downtime comment sync
2025-01-07 13:32:49 +01:00
Julian Brost cf125dd8d5 Simplify `DependencyGraph:RemoveDependency()` method 2025-01-07 11:07:46 +01:00
Yonas Habteab ff0e12e6ac ApiListener: Sync runtime configs in order 2025-01-07 11:07:46 +01:00
Yonas Habteab 015374e69d DependencyGraph: Allow lookups by parent & child dependencies 2025-01-07 11:07:46 +01:00
Julian Brost 8ae2659aa7
Merge pull request #10275 from Icinga/Al2Klimov-patch-3
GHA: drop EOL SUSE versions
2025-01-07 10:38:42 +01:00
Julian Brost aa249d84f7
Merge pull request #10277 from Icinga/Al2Klimov-patch-6
GHA: Amazon Linux: fix broken link to Boost tarball
2025-01-07 10:35:53 +01:00
Alexander Aleksandrovič Klimov 7ea0f5969f
GHA: Amazon Linux: fix broken link to Boost tarball 2025-01-02 15:35:29 +01:00
Alexander Aleksandrovič Klimov b2288d2925
GHA: also test SLES, not just openSUSE
They may be similar, but SLES isn't that hard to deploy.
2025-01-02 15:26:31 +01:00
Alexander Aleksandrovič Klimov f098810892
GHA: drop EOL SUSE 15.4 2024-12-18 15:32:37 +01:00
Alexander Aleksandrovič Klimov 929deffb4b
GHA: drop EOL SLES 15.3 2024-12-18 15:31:56 +01:00
Alexander Aleksandrovič Klimov d9cbed439a
GHA: drop EOL SLES 12.5 2024-12-18 15:30:40 +01:00
Alexander Aleksandrovič Klimov 383773eb2b
Merge pull request #10264 from Icinga/DependencyGraph-ConfigObject
DependencyGraph: use ConfigObject*, not Object*
2024-12-18 13:36:56 +01:00
Alexander A. Klimov 3a09cf72d6 DependencyGraph: use ConfigObject*, not Object*
This saves dynamic_cast<ConfigObject*> + if() on every item of GetChildren().
2024-12-17 18:33:05 +01:00
Julian Brost 452386cdb6
Merge pull request #10005 from Icinga/graceful-tls-disconnect
Add a dedicated method for disconnecting TLS connections
2024-12-12 16:20:14 +01:00
Julian Brost 3642ca3369
Merge pull request #10263 from Icinga/DependencyGraph-parent-child
DependencyGraph: switch "parent" and "child" terminology
2024-12-12 15:13:08 +01:00
Julian Brost a506d562ae Add comment for remaining uses of async_shutdown() why it's safe
The reason for introducing AsioTlsStream::GracefulDisconnect() was to handle
the TLS shutdown properly with a timeout since it involves a timeout. However,
the implementation of this timeout involves spwaning coroutines which are
redundant in some cases. This commit adds comments to the remaining calls of
async_shutdown() stating why calling it is safe in these places.
2024-12-12 12:10:59 +01:00
Julian Brost e6d103d0dd HttpServerConnection: use AsioTlsStream::GracefulDisconnect()
This new helper function has proper timeout handling which was missing here.
2024-12-12 12:10:59 +01:00
Julian Brost 007e3fbe7e JsonRpcConnection: use AsioTlsStream::GracefulDisconnect()
This new helper functions allows deduplicating the timeout handling for
`async_shutdown()`.
2024-12-12 12:10:59 +01:00
Julian Brost 56d5811283 AsioTlsStream: add GracefulDisconnect() and ForceDisconnect()
Calling `AsioTlsStream::async_shutdown()` performs a TLS shutdown which
exchanges messages (that's why it takes a `yield_context`) and thus has the
potential to block the coroutine. Therefore, it should be protected with a
timeout. As `async_shutdown()` doesn't simply take a timeout, this has to be
implemented using a timer. So far, these timers are scattered throughout the
codebase with some places missing them entirely. This commit adds helper
functions to properly shutdown a TLS connection with a single function call.
2024-12-12 12:10:59 +01:00
Alexander A. Klimov 188ba53b74 DependencyGraph: switch "parent" and "child" terminology
The .ti files call `DependencyGraph::AddDependency(this, service.get())`. Obviously, `service.get()` is the parent and `this` (Downtime, Notification, ...) is the child. The DependencyGraph terminology should reflect this not to confuse its future users.
2024-12-04 10:57:30 +01:00
Nicolas Rodriguez e881898ce0 Add missing option "--unplugged_nics_state" to vmware-esx-soap-host-net and vmware-esx-soap-host-net-nic 2024-12-03 15:23:46 +01:00
Julian Brost e50eb52291
Merge pull request #9825 from Icinga/Al2Klimov-patch-8
Doc: Distributed Monitoring: add section "External CA/PKI"
2024-12-02 10:00:55 +01:00
Alexander Aleksandrovič Klimov 8f51f54f19
Merge pull request #10221 from Icinga/Al2Klimov-patch-7
JsonRpcConnection: don't write new messages on shutdown
2024-11-29 09:24:10 +01:00
Julian Brost b8f6d7344d
Merge pull request #10258 from Icinga/Al2Klimov-patch-11
GHA: Linux: don't track all supported distro versions
2024-11-27 17:20:25 +01:00
Julian Brost 57df92fa51
Merge pull request #10141 from Icinga/log-slow-http-rpc-processing
Log HTTP/RPC message processing stats
2024-11-27 17:15:36 +01:00
Alexander A. Klimov cca5f6603b GHA: Linux: don't track all supported distro versions
Instead just give a generic explanation per distro.
2024-11-27 15:20:28 +01:00
Alexander A. Klimov 501175229c Doc: Distributed Monitoring: add section "External CA/PKI"
The following already works:

* Custom key sizes, e.g. 2048 bits
* Custom key types, e.g. ECC
* Multiple trusted root CAs in `/var/lib/icinga2/certs/ca.crt`
* Different root CAs per cluster subtree, as long as each node trusts the
  issuers of the certificates of all nodes it's directly connected to
* Any number of intermediate CAs
2024-11-27 14:49:06 +01:00
Yonas Habteab 4564c068fe JsonRpcConnection: Log message processing time stats
Co-Authored-By: Julian Brost <julian.brost@icinga.com>
2024-11-27 09:57:38 +01:00
Yonas Habteab e0b053cbe1 HttpServerConnection: Log noticable CPU semaphore wait time 2024-11-27 09:57:38 +01:00
Julian Brost 4b884ea953
Merge pull request #10253 from Icinga/Al2Klimov-patch-11
GHA: update supported Fedora versions
2024-11-27 09:54:30 +01:00
Julian Brost 5c7bbf17c5
Merge pull request #10251 from Icinga/drop-ubuntu-23-10
GHA: Drop ubuntu 23.{04,10} (EOL)
2024-11-26 16:19:05 +01:00