14048 Commits

Author SHA1 Message Date
Alexander A. Klimov
31f3acaa13 ConfigItem::CommitNewItems(): pre-sort types by their load dependencies once
to avoid complicated nested loops, iterating over the same types and
checking dependencies over and over, skipping already completed ones.
2024-09-20 16:18:12 +02:00
Alexander A. Klimov
b848934d57 Introduce Type::GetConfigTypesSortedByLoadDependencies() 2024-09-20 16:18:12 +02:00
Yonas Habteab
4f690a6fde
Merge pull request #10169 from Icinga/Type-GetLoadDependencies-ConfigObject
Type#GetLoadDependencies(): VERIFY() that only config object types are returned
2024-09-20 16:11:17 +02:00
Alexander A. Klimov
b6517c6973 Type#GetLoadDependencies(): VERIFY() that only config object types are returned 2024-09-20 14:35:19 +02:00
Alexander A. Klimov
4b20121dcf Type#GetLoadDependencies(): group operations by type 2024-09-20 14:35:19 +02:00
Yonas Habteab
dac747f9d4
Merge pull request #10155 from Icinga/Type-GetLoadDependencies-nullptr
Type#GetLoadDependencies(): VERIFY() that no nullptr is returned
2024-09-20 12:29:48 +02:00
Alexander A. Klimov
c24713ac10 Type#GetLoadDependencies(): VERIFY() that no nullptr is returned 2024-09-19 16:43:00 +02:00
Alexander A. Klimov
36742c27b9 Don't override Type#GetLoadDependencies() if latter is sufficient
If a specific type shall return no deps, the base method already does that.
2024-09-19 15:47:25 +02:00
Yonas Habteab
e678f0977d
Merge pull request #10151 from Icinga/bugfix/do-not-sync-partially-initialised-objects
IcingaDB: Don't sync partially initialised objects
2024-09-18 15:48:42 +02:00
Yonas Habteab
3ffec77ae5
Merge pull request #10135 from Icinga/centos
doc/: don't mention CentOS
2024-09-18 10:22:09 +02:00
Yonas Habteab
7b12a8feeb
Merge pull request #10156 from Icinga/Al2Klimov-patch-7
Linux Dev Environment: fix /usr/local/icinga2/etc ownership
2024-09-16 17:51:34 +02:00
Alexander A. Klimov
6da948c830 doc/: don't mention CentOS
It's EOL.
2024-09-16 17:08:42 +02:00
Alexander Aleksandrovič Klimov
f3ed85171e
Linux Dev Environment: fix /usr/local/icinga2/etc ownership
We instruct the users to build as root and chown just /usr/local/icinga2/var, but at least `icinga2 api setup` also needs to modify /usr/local/icinga2/etc.
2024-09-16 16:13:02 +02:00
Yonas Habteab
0b8f70bbba
Merge pull request #10152 from Josef-Friedrich/remove-trailing-whitespaces
Remove trailing whitespaces in the markdown files of the documentation
2024-09-13 10:06:45 +02:00
Julian Brost
b62326d30c
Merge pull request #10153 from Josef-Friedrich/typo-api-docs
Fix typo in the api documentation
2024-09-12 10:37:06 +02:00
Josef Friedrich
1cd515ef8a
Fix typo in the api documentation 2024-09-12 08:46:27 +02:00
Josef Friedrich
1f31f725f8 Remove trailing whitespaces in the markdown files of the documentation 2024-09-12 08:39:15 +02:00
Yonas Habteab
26f43b0b48 IcingaDB: Don't sync partially initialised objects 2024-09-11 14:08:27 +02:00
Yonas Habteab
8beb0b74ab
Merge pull request #10149 from Icinga/fix-format-datetime-tests-on-darwin
tests: Fix test `FormatDateTime` with invalid formats on macOS/*BSD
2024-09-10 18:48:26 +02:00
Yonas Habteab
b8932e67fc tests: Fix test FormatDateTime with invalid formats on macOS/*BSD 2024-09-10 17:11:20 +02:00
Yonas Habteab
c0b047b1aa
Merge pull request #10035 from Icinga/check_systemd_name_fix
check_systemd: Fix executable name and include latest arguments
2024-09-06 11:57:33 +02:00
Alvar Penning
e7670e9ba9
check_systemd: harmonize ITL w/ upstream
Harmonize the arguments with the upstream CheckCommand[0], including a
patch to use the ITL variables[1].

[0]: https://github.com/Josef-Friedrich/check_systemd/blob/main/contrib/icinga2/command.conf
[1]: https://github.com/Josef-Friedrich/check_systemd/pull/38

Co-Authored-By: RincewindsHat <12514511+RincewindsHat@users.noreply.github.com>
2024-09-06 10:21:30 +02:00
Yonas Habteab
74009f0fcb Don't use thread-local variable in coroutine & process final cr in global thread pool 2024-09-05 17:36:03 +02:00
Yonas Habteab
c9159494c0 HttpServerConnection: Drop yet another superfluous CpuBoundWork usage 2024-09-05 15:10:14 +02:00
Yonas Habteab
5cc034b38f
Merge pull request #10147 from Icinga/Al2Klimov-patch-7
Utility::ReleaseHelper(): remove detection of EOL distros
2024-09-05 09:27:51 +02:00
Alexander Aleksandrovič Klimov
79e3cb2a95 Utility::ReleaseHelper(): remove detection of EOL distros
We only support /etc/os-release owners.
2024-09-04 10:26:50 +02:00
Alexander Aleksandrovič Klimov
0951230ce1
Merge pull request #9991 from Icinga/JsonRpcConnection-9985
JsonRpcConnection#Send*(): discard messages ASAP once shutting down
2024-09-03 15:13:30 +02:00
Julian Brost
4c6b93d617
Merge pull request #10011 from Icinga/next-check-cluster-sync-issue
Checkable: Don't recalculate `next_check` for remotely generated `cr`
2024-08-30 13:37:41 +02:00
Lorenz Kästle
ba200f74e1
Add check_curl to ITL (#9205)
* Add check_curl to ITL

* small fixes and boolean defaults

* Add documentation for check_curl

* Replace dash with underscore in variables

* Add link to documentation

* Change order of argument attributes to adhere to style guide

* Shorten description of  tls option in itl

* Just remove information for check_curl options

* itl - check_curl: document -4 and -6

* itl - check_curl: Add haproxy option for check_curl

* itl - check_curl: add cookie-jar option

* itl - check_curl: add continue_after_certificate option

* itl - check_curl: replace dashes with underscores in macros

* Update itl/command-plugins.conf

Co-authored-by: alvar <8402811+oxzi@users.noreply.github.com>

* Update itl/command-plugins.conf

Co-authored-by: alvar <8402811+oxzi@users.noreply.github.com>

* itl - check_curl: add missing option documentation and reorder options

* itl - check_curl: Split certificate lifetime in two parameters

* itl - check_curl: replace remaining instances of single parameter for remaining valid time

* check_curl: allow assignements for host without address set

* check_curl: fix typo expext -> expect

* itl - check_curl: add state-regex option and documentation

* Add Tls options with version and without

* itl - check_curl: fix indentation

* itl - check_curl: Set v4/v6 variables

* itl - check_curl: Edit description for --sni

* doc - check_curl: fix singular-plural typo for curl_max_redir(s)

* doc/check_curl: sni description

* itl - check_curl: remove superfluous brace

* itl - check_curl: add extra-opts parameter

---------

Co-authored-by: alvar <8402811+oxzi@users.noreply.github.com>
2024-08-30 10:25:27 +00:00
Julian Brost
73d3e5b1c7
Merge pull request #10136 from Icinga/icinga-archive-keyring
.deb: let user install icinga-archive-keyring package
2024-08-29 17:36:20 +02:00
Yonas Habteab
9f84c1516e ApiListener: Reorder logging in ApiTimerHandler() 2024-08-28 16:53:53 +02:00
Yonas Habteab
e062ceb901 ApiListener: Catch & supress clients runtime errors 2024-08-28 16:53:53 +02:00
Yonas Habteab
894d6aa290
Merge pull request #9974 from tbauriedel/fix/itl-http-definition
Fix ITL for http CheckCommand definition
2024-08-27 15:45:00 +02:00
Julian Brost
88e79ea41a
Merge pull request #10111 from Icinga/unregister-invalid-objects-properly
Unregister invalid config objects properly
2024-08-27 14:30:38 +02:00
Yonas Habteab
932a53449d JsonRpcConnection: Raise an exception when trying to send to disconnected clients 2024-08-27 14:23:41 +02:00
Julian Brost
9222a63ff7 Make sure log file is reopened when ApiListener::ReplayLog() returns 2024-08-27 14:23:41 +02:00
Yonas Habteab
a5a83e311a Defer: Allow empty initialization & add SetFunc() method 2024-08-27 14:23:41 +02:00
Yonas Habteab
73db30c08b Use Defer class for cleanup in ApiListener::ReplayLog() 2024-08-27 14:23:41 +02:00
Alexander A. Klimov
f074e24d2a ApiListener#ReplayLog(): stop reading files ASAP on send error 2024-08-27 14:23:41 +02:00
Alexander A. Klimov
b538ad2528 JsonRpcConnection#Send*(): discard messages ASAP once shutting down
Especially ApiListener#ReplayLog() enqueued lots of messages into
JsonRpcConnection#{m_IoStrand,m_OutgoingMessagesQueue} (RAM) even if
the connection was shut(ting) down. Now #Disconnect() takes effect ASAP.
2024-08-27 14:23:41 +02:00
Alexander A. Klimov
33f8ea6dcc JsonRpcConnection#Disconnect(): spawn coroutine only if necessary
by checking the now atomic #m_ShuttingDown outside of it.
2024-08-27 14:23:41 +02:00
Tobias Bauriedel
600281bfa0
Fix ITL for http CheckCommand definition
There were some missing arguments.

ref/NC/806131
2024-08-27 14:07:43 +02:00
Yonas Habteab
a51910a19b
Merge pull request #9975 from nicolasberens/bugfix/update-check_snmp-9907
add multiplier option to check_snmp which is available since monitori…
2024-08-26 17:12:09 +02:00
Nicolas Berens
c76cade9ae add new variables to documentation 2024-08-26 15:36:21 +02:00
Nicolas Berens
91b1638a01 add multiplier option to check_snmp which is available since monitoring-plugins v2.3.3, refs #9907 2024-08-26 15:36:21 +02:00
Julian Brost
145bb6109b
Merge pull request #10112 from Icinga/formatdatetime
Overhaul Utility::FormatDateTime()
2024-08-26 14:31:00 +02:00
Julian Brost
585b357c3f
Merge pull request #10090 from Icinga/rpi-os
Clarify that our Debian installation docs also apply to the Raspberry Pi OS
2024-08-26 13:54:30 +02:00
Alexander A. Klimov
f96e7c67ee On Windows, don't create C:\Program Files\Icinga2\var during MSI build 2024-08-23 12:49:09 +02:00
Julian Brost
39ae2e8ca4 Utility::FormatDateTime(): provide an overload for tm*
This allows the function to be used both with a double timestamp or a pointer
to a tm struct. With this, a similar implementation inside the tests can simply
use our regular function.
2024-08-23 12:48:50 +02:00
Julian Brost
d5b3ffaa6d Utility::FormatDateTime(): handle invalid format strings on Windows
On Windows, the strftime() function family invokes an invalid parameter handler
when the format string is invalid (see the "Remarks" section in their
documentation). std::put_time() shows the same behavior as it uses
_wcsftime_l() internally. The default invalid parameter handler may terminate
the process, which can be a problem given that the format string can be
specified by the user from the Icinga DSL.

Thus, temporarily set a thread-local no-op handler to disable the default one
allowing the program to continue. This then simply results in the function
returning an error which then results in an exception as we ask the stream to
throw one.

See also:
https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/strftime-wcsftime-strftime-l-wcsftime-l?view=msvc-170
https://learn.microsoft.com/en-us/cpp/c-runtime-library/parameter-validation?view=msvc-170
https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/set-invalid-parameter-handler-set-thread-local-invalid-parameter-handler?view=msvc-170
2024-08-23 12:48:50 +02:00