Commit Graph

195 Commits

Author SHA1 Message Date
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 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 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
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
Alexander A. Klimov bb13e98ca5 PluginCheckTask::ProcessFinishedHandler(): warn about exit codes outside 0..3
in the plugin output as well, in addition to the warning log.
2024-04-23 17:45:31 +02:00
Alexander A. Klimov 175153ce6a PluginNotificationTask::ScriptFunc(): on Linux truncate output and comment
not to run into an exec(3) error E2BIG due to a too long argument.
This sends a notification with truncated output instead of not sending.
2023-12-19 12:21:03 +01:00
Alexander Aleksandrovič Klimov e5d988a2fe
Merge pull request #7799 from Icinga/bugfix/file-end
Fix file endings
2023-08-25 11:06:19 +02:00
Alexander Aleksandrovič Klimov 000a776dfb
Built-in check command: ifw-api (#9062) 2023-07-06 14:18:21 +02:00
Alexander A. Klimov 9376a311ea Fix file endings
git ls-files -z \
	|grep -zEe '^lib/' \
	|grep -zEe '\.[ch]pp$' \
	|xargs -0 perl -p0i -e 's/\n*(?!(?:.|\n))/\n/'
2023-05-17 18:05:13 +02:00
Alexander A. Klimov f2974c07cf Centralise default icinga.* and env.* macros 2023-02-17 15:33:36 +01:00
Alexander A. Klimov b2b49caf61 Macros: support $env.ENV_VAR_NAME$
refs #6259
2023-02-10 17:21:29 +01:00
Julian Brost a259650bea
Merge pull request #8595 from Icinga/bugfix/cluster-zone-own-zone-8570
cluster-zone: consider own zone connected if there's only one endpoint
2023-01-17 17:26:14 +01:00
Yonas Habteab 43ba2da39c Replace std/boost::bind() function with lambda expression 2021-03-10 16:29:40 +01:00
Alexander A. Klimov b90b77b275 cluster-zone: consider own zone connected if there's only one endpoint
... because in this case only the checking node can be (not) connected to itself.

refs #8570
2021-01-14 17:28:46 +01:00
Alexander A. Klimov 0ad1ab20aa Fix code style
refs #8034
2020-11-23 16:39:24 +01:00
Mattia Codato c2f8d6df44 Use ternary operator to get ExecuteOverride or checkable command 2020-08-03 08:07:32 +02:00
Mattia Codato 9c4a3aed1b Use ExecuteOverride to override the command 2020-07-31 17:28:33 +02:00
Mattia Codato d7dadbfc66 Use MacroResolver::OverrideMacros on *task files 2020-07-31 14:21:09 +02:00
Mattia Codato 96dc349240 Fix scriptfunc for dummychecktask, exceptionchecktask and sleepchecktask 2020-07-22 11:38:41 +02:00
Mattia Codato 867da09fb4 Revert "Use ExecuteCommandProcessFinishedHandler in TimePeriodTask"
This reverts commit abf164bceb.
2020-07-21 10:52:59 +02:00
Mattia Codato abf164bceb Use ExecuteCommandProcessFinishedHandler in TimePeriodTask 2020-07-21 09:57:59 +02:00
Mattia Codato 986c07fd7d Use ExecuteCommandProcessFinishedHandler in NullEventTask 2020-07-21 08:33:43 +02:00
Mattia Codato 8758e58b92 Use ExecuteCommandProcessFinishedHandler for all lib/methods/*task.cpp 2020-07-20 16:29:26 +02:00
Mattia Codato 27f8bc5920 Call ExecuteCommandProcessFinishedHandler for notification and event commands 2020-07-15 09:14:01 +02:00
Mattia Codato a3027d7177 Fix ExecuteCommandProcessFinishedHandler parameters 2020-07-13 16:54:37 +02:00
Mattia Codato 6bad8bbc0f Replace executeactiontask with a lambda function 2020-07-13 09:47:19 +02:00
Mattia Codato 15159b1632 Add ExecuteCommandProcessFinishedHandler and checkable param to ExecuteRemoteCheck 2020-07-10 16:56:07 +02:00
Mattia Codato c3d9f6c17b Add ExecuteActionTask 2020-07-10 16:51:45 +02:00
Mattia Codato a33560548c Refactor MacroResolver::OverrideMacros 2020-07-03 15:53:51 +02:00
Mattia Codato be2701bc8a Add overrideMacros property to MacroResolver 2020-07-03 15:13:51 +02:00
Michael Friedrich ae8a0b6a64 Introduce Application::GetUptime() 2020-02-11 16:47:50 +01:00
Michael Friedrich 152709071d Revert "Implement last_notification_result handling for Notification objects"
This reverts commit 1706b297a5.
2020-01-07 14:21:06 +01:00
Michael Friedrich 55d7da30ca Metrics: Expose problem/handled counts for hosts/services
With the addition of problem/handled as checkable runtime
attributes in #7096 we should also expose them via CIB
into

- icinga check
- /v1/status/CIB
- IcingaApplication runtime macros

This originates from a request by @phil-or at the recent
Icinga meetup in Linz.
2019-08-29 17:04:23 +02:00
Alexander A. Klimov efc7f2cf8d Correct current_concurrent_checks to actually running checks
refs #7416
2019-08-15 13:39:01 +02:00
Michael Friedrich c2e1d023e2
Merge pull request #7421 from Icinga/feature/threadpool-metric
Expose metric current_pending_callbacks
2019-08-15 10:51:31 +02:00
Alexander A. Klimov 448a991404 Expose metric current_pending_callbacks 2019-08-14 17:22:27 +02:00
Michael Friedrich 5b36ff0787 Properly parse the Icinga version for minimum version in the 'icinga' check
fixes #7415
2019-08-14 13:15:05 +02:00
Michael Friedrich 8098f4d54d Improve type logging for notifications 2019-07-16 13:46:16 +02:00
Michael Friedrich 406ecb448c Internal methods must update the 'command' key in the check result
Currently this is `null` which isn't really correct.

As otherwise, it is tremendously hard to figure out which check
command was involved, if you're not looking at the `.check_command`
checkable object.
2019-07-10 10:15:15 +02:00
Michael Friedrich 2acf3a6941 Indicate a warning in the 'icinga' check when cluster stage validation failed
- success: clear the last failed attribute
- failed: populate it with the output and current timestamp

This can be used to highlight this in the 'icinga' check task.
Since 2.9 we don't have problems with circular library dependencies
with just one linked binary, therefore it is safe to include libremote
in libmethods here.
2019-06-19 14:46:11 +02:00
Michael Friedrich 2ba2134eda
Merge pull request #7156 from Icinga/feature/itl-sleep
Implement sleep CheckCommand
2019-05-24 15:42:46 +02:00
htriem 75df3879f2 Implement sleep CheckCommand in memory
Implements a check task with Utility::Sleep and custom var parameter sleep_time (default value: 1s)

refs #6964
2019-05-02 16:24:42 +02:00
Michael Friedrich 1706b297a5 Implement last_notification_result handling for Notification objects 2019-03-28 10:43:35 +01:00
Michael Friedrich 458f997a18 Replace Copyright header with a short version, part II 2019-02-25 15:09:36 +01:00
Michael Friedrich d14a88235d Replace Copyright header with a short version, part I
CLion -> replace in path
2019-02-25 14:48:22 +01:00
Michael Friedrich 3d45d0bcf6 Minor styleguide 2018-10-29 13:45:18 +01:00
Max Rosin 2366df6057 Fix the Icinga2 version check for versions with more than 5 characters
The previous implementation assumed that every version number will have
5 characters. With the release of 2.10.0 this does not work anymore.
The new implementation extracts everything from the second character to
the first dash. This should work as long as the version string is in a
format like 'v2.10.1-8-gaebe6da'.

fixes Icinga#6703
2018-10-19 15:37:32 +02:00
Michael Friedrich eabea68c56 icinga.com: Update config files (ITL, etc.) 2018-10-18 09:37:59 +02:00