How to have Icinga internal DSL check routine to pass result information to event handler

Hi Icinga admins.

We’re looking for an option to have a ICINGA DSL check routine to pass “a result” to the associated event handler. Although not fully investigated it seems that only host/service runtime attribute last_check_result is a candidate but i have no clue if/how the check code can somewhat pass by output or other way to the event handler.
Any idea, hint or question is highly welcome.
Best regards
Michael


Background
By using the powerful ICINGA DSL we have developed a quite handy scenario correlation check which could be specified by a custom check variable array condition_matrix.
It is evaluated by Icinga as a dummy check DLS check command function and dummy_text is producing a Plugin output as shown here:


The “additional result” we want to pass to event handler is the list of CRITICAL offenders.

Hi,

you can use the runtime macro $service.output$ and pass it as argument value in your EventCommand definition. Your event handler needs to parse the input parameter and “do something” with it.

last_check_result is of the CheckResult value, which can be serialized into JSON, but that doesn’t make much sense for passing raw strings to event handler scripts. If the interface for event handlers would be better, one could that - but such a thing doesn’t exist (yet).

Cheers,
Michael