205 Commits

Author SHA1 Message Date
Julian Brost
31a224c509 Checkable::GetSeverity(): always take reachability into account
So far, Service::GetSeverity() only considered the state of its own host, i.e.
the implicit service to its own host dependency, and treated it similar to
acknowledgements and downtimes. In contrast, Host::GetSeverity() considered
reachability and treated it like a state, i.e. for the severity calculation,
the host was either up, down, or unreachable.

This commit changes the following things:
1. Make the service severity also consider explicitly configured dependencies
   by using IsReachable().
2. Prefer acknowledgements and downtimes over unreachability in the severity
   calculation so that if an already acknowledged or in-downtime services (i.e.
   already handled service) becomes unreachable, it shouln't become more
   severe.
3. To unify host and service severities a bit, hosts now use the same logic
   that treats reachability more like acknowledgements/downtimes instead of
   like a state (changing the other way around would the state from the check
   plugin would not affect the severity for unrachable services anymore).
2025-03-31 15:23:51 +02:00
Julian Brost
1e05a166f1 Host::GetSeverity(): remove empty line at end of method 2025-03-31 15:23:51 +02:00
Julian Brost
d8271c6568 Host::GetSeverity(): remove explicit unlocking
No change in functionality. The ObjectLock destructor will implicitly release
the locks when returning from the function.
2025-03-31 15:23:51 +02:00
Julian Brost
2ebee010f0 Host::GetHost(): return early to remove a nesting level
No change in functionality. The first two branches actually set the final
return value for the method, so they can just return directly, removing the
need to have the rest of the function inside an else block.
2025-03-31 15:23:51 +02:00
Julian Brost
6443f8997f Host::GetSeverity(): add braces to if statements
No change in functionality, just makes the code a bit nicer.
2025-03-31 15:23:51 +02:00
Michael Insel
da394b2ab0
Implement scheduling_source attribute (#6326)
* Implement scheduling_source attribute

This implements the attribute `scheduling_source` for hosts and services to show which endpoint is running the scheduler for the check.

refs #4814
2021-07-20 11:10:26 +02:00
Alexander A. Klimov
c3388e9af6 Use std::mutex, not boost::mutex 2021-02-03 09:54:57 +01:00
Jean Flach
037357aea5 Add severity 2019-11-02 14:00:23 +01:00
Alexander A. Klimov
d33cfdf3c0 Declare Checkable#IsStateOK() const 2019-04-09 11:26:34 +02: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
dab53448bc icinga.com: Update *.{h,c}pp 2018-10-18 09:27:04 +02:00
Gunnar Beutner
9d436605f0 Fix compatibility with CMake < 3.1 2018-01-18 15:12:46 +01:00
Gunnar Beutner
ac155d1dda Apply clang-tidy fix 'modernize-redundant-void-arg' 2018-01-04 12:24:57 +01:00
Michael Insel
158ae2188e Change copyright header for 2018 2018-01-02 12:08:55 +01:00
Jean Flach
2636e6a77a Whitespace fix
What does this change?
* Remove use of spaces for formatting
These could be found by using `grep -r -l -P '^\t+ +[^*]'
* Removal of training whitespaces
* A few lines longer than 120 chars
2017-12-20 14:53:52 +01:00
Gunnar Beutner
325e4a2fb9 Use nullptr instead of <Type>::Ptr() 2017-11-30 17:47:09 +01:00
Michael Friedrich
dc7980586b Implement severity attribute for host/service objects
refs #5117
2017-04-13 16:09:31 +02:00
Michael Friedrich
b7caf0820d Ensure that *.icinga.com is used everywhere
fixes #13897
fixes #13277
2017-01-10 17:19:12 +01:00
Gunnar Beutner
5058c5d75b Use 'auto' for iterator declarations
fixes #12561
2016-08-27 08:37:19 +02:00
Gunnar Beutner
288413f046 Replace BOOST_FOREACH with range-based for loops
fixes #12538
2016-08-25 06:46:17 +02:00
Gunnar Beutner
218e780a44 Avoid unnecessary string copies
fixes #12509
2016-08-23 15:01:40 +02:00
Gunnar Beutner
e3f1c1ec6f Make sure timestamps are formatted as integers in macro strings
refs #11483
2016-06-21 11:29:12 +02:00
Michael Friedrich
b4c56e5f47 Remove duplicate last_check runtime macro
Already available as {host,service}.last_check attribute.

refs #11483
2016-06-16 17:39:59 +02:00
Gunnar Beutner
bc6f7d7a21 Fix incorrect formatting for some macro values
fixes #11483
2016-06-16 15:14:35 +02:00
Michael Friedrich
ba82d2eb20 Move CalculateExecutionTime and CalculateLatency into the CheckResult class
fixes #11751
2016-05-10 12:16:49 +02:00
Michael Friedrich
3bd6848763 Refactor patch for host recovery notifications
refs #10225
2016-03-15 09:47:59 +01:00
Michael Friedrich
d9fac2b613 Raise a config error for "Checkable" objects in global zones
fixes #10807
2016-01-14 15:34:38 +01:00
Gunnar Beutner
599929b0f6 Update copyright headers for 2016 2016-01-12 08:29:59 +01:00
Michael Friedrich
43976d3989 Add host.last_state_{up,down} and last_check attribute, hide *_raw attributes
fixes #10508
fixes #10509
2015-11-02 14:10:44 +01:00
Gunnar Beutner
050c520b2a Convert Comment/Downtime to config objects
fixes #9777
2015-10-28 17:56:29 +01:00
Gunnar Beutner
fd5d6de52e Improve performance for Livestatus queries
refs #10428
2015-10-22 08:28:40 +02:00
Gunnar Beutner
f45f6ccd82 Implement support for tracking dependencies between config objects
refs #9096
2015-08-25 13:54:05 +02:00
Gunnar Beutner
72a7b08480 Move implementation code from thpp files into separate files
fixes #8890
2015-03-28 11:08:12 +01:00
Gunnar Beutner
ec7224e3ed Generate C++ code for type validators
fixes #7709
fixes #8867
2015-03-27 07:59:27 +01:00
Gunnar Beutner
e22386e63f Make load order for objects more reliable
fixes #8770
2015-03-19 15:58:38 +01:00
Michael Friedrich
b23d58dccc Add host/service runtime macro downtime_depth
fixes #8195
2015-02-08 00:15:38 +01:00
Stephan Platz
2d393eab28 Add macro "check_source" for hosts and services to use them in notification mails
fixes #8277

Signed-off-by: Gunnar Beutner <gunnar@beutner.name>
2015-01-25 16:04:36 +01:00
Michael Friedrich
78bfd0204c Update copyright year 2015-01-22 12:00:23 +01:00
Gunnar Beutner
9f18211ada Remove obsolete code
refs #7709
2014-12-18 15:57:30 +01:00
Gunnar Beutner
873e294158 Refactor the WorkQueue class to make error reporting easier
refs #7709
2014-12-18 15:11:57 +01:00
Gunnar Beutner
2720333d6e Fix missing location information for included files
fixes #7927
2014-12-10 15:06:09 +01:00
Gunnar Beutner
9dfa3d22d4 Implement support for arrays in command arguments
fixes #6709
2014-11-27 13:24:07 +01:00
Gunnar Beutner
334e61037a Split DynamicObject::OnConfigLoaded into two separate events
refs #7780
2014-11-21 18:31:37 +01:00
Gunnar Beutner
0078e00c13 Refactor apply/object rules
fixes #7700
2014-11-20 21:29:50 +01:00
Gunnar Beutner
478f03b49a Replace boost::shared_ptr with boost::intrusive_ptr
refs #7622
2014-11-09 16:54:41 +01:00
Gunnar Beutner
4cb3d5b1f0 Fix "assign where" for nested groups
fixes #7475
2014-10-28 18:58:22 +01:00
Gunnar Beutner
7559273359 Replace cJSON with YAJL
fixes #7452
2014-10-26 20:00:35 +01:00
Gunnar Beutner
632026cd9f Rename C++ header files.
Fixes #6291
2014-05-25 16:27:14 +02:00
Gunnar Beutner
9c3e399188 Remove unnecessary includes.
Fixes #6189
2014-05-11 18:11:32 +02:00
Michael Friedrich
ad77709c07 Rename host.total_* runtime macros to host.num_*.
Fixes #6188
2014-05-11 15:08:32 +02:00