Let's say a given host, FooHost
, is running Apache2. Icinga2 runs a check by ssh command and discovers that Apache2 is not running, which triggers a critical alert.
Is it possible to have Icinga2 execute a script on this event? In this example, I would like to write a script that does an SSH remote execute of systemctl restart apache2
.
In the alternative, we could write a watchdog script that could be deployed on all servers, but it makes MUCH more sense to write it on the Icinga2 box, and use ssh remote execute because that allows central control.
I see no reason to have to have an engineer log in to fix this unless this restart failed also.