I’ve been looking for information about how I could increasing the value of max_check_attempts of a service depending on its status. I want to increase it ONLY when the state be UNKNOWN.
The if is evaluated during configuration so it is always depending on the state during reload. For an evaluation during runtime you need the attribute to return a function. But I am not sure if this works for this specific attribute.
Unfortunately the checkconfig detects a config error.
[2022-04-04 09:40:59 -0500] critical/config: Error: Error while evaluating expression: Can’t convert ‘Object of type ‘Function’’ to a floating point number.