[Icinga-devel] Introducing a soft-OK state

Edgar Fuß ef at math.uni-bonn.de
Wed Sep 19 16:45:21 CEST 2018

Is this list alive? If not, what's the preferred way to discuss topics like this?

I'm working on introducing a soft-OK state. I have services that intermittently report OK despite being non-OK (in case someone cares: printers where Alerts vanish from the prtAlert table for a few seconds to re-appear at another position) and I guess such a feature would be useful in general.
The idea is to add a min_recover_attempts attribute to a Service object, defaulting to 1.

The place to add the logic (minus introduction of the attribute, documentation etc.) is Checkable::ProcessCheckResult().
However, the logic in there is convoluted beyond belief. I ended up with a table listing all the possible state transitions and corresponding values of bool variables and if conditions.
Some of the expressions are overly complicated, some useless, some harmful, some don't match the comments.

Worst example (yet):
if (IsStateOK(old_state) && old_stateType == StateTypeSoft)
	send_notification = false; /* Don't send notifications for SOFT-OK -> HARD-OK. */
1. There is no such thing as soft OK (yet).
2. If there were a soft OK state, the expression would supress notifications for soft OK -> hard CRITICAL
3a. For non-volatile checkables, send_notification would be false anyway for soft OK -> hard OK (it's false for any soft -> OK transition)
3b. For volatile checkables, send_notifications is set to false for any OK -> OK transition just below.

So, before adding a soft-OK state I would like to clean up that logic.
However, for some conditions, I'm unsure what the intended behaviour is.
I'd also like someone to double-check my corretions.

More information about the icinga-devel mailing list