Force Check if another Check returns something other than OK

Hello,

I am currently looking into a way to trigger A check from a Different Check.

E.g.

When Check $A gets triggered, Icinga should then immediately execute Check $B instead of its usual intervall

My current Attempt would be to add an EventCommand to Check $A which executes a script to call the API and schedules a check for Check $B.

But i am curious if there is a better way to achieve this behaviour.

All the best,

Nicolas

No, event commands are the intended mechanism for this use case.
Be careful to filter the incoming events so it will only trigger the API, when you really want.

You could create a custom EventCommand which utilizes the Icinga 2 API to reschedule the other check, https://icinga.com/docs/icinga-2/latest/doc/12-icinga2-api/#reschedule-check.