You can use the restart limit statement with exec action, see monit manual for more details: https://mmonit.com/monit/documentation/monit.html#SERVICE-RESTART-LIMIT <https://mmonit.com/monit/documentation/monit.html#SERVICE-RESTART-LIMIT>
Regards, Martin > On 17 Nov 2016, at 15:55, Brandon Reeves <[email protected]> wrote: > > Thanks > > So is it possible to do the logic with monit? > > Ex if service fails restart then run script or should I do all of it within a > shell script? > > > > On Nov 17, 2016, at 08:24, Bryan Harris <[email protected] > <mailto:[email protected]>> wrote: > >> I think you might have to do all the logic in your script. >> >> V/r, >> Bryan >> >> Sent from my iPhone >> >> On Nov 17, 2016, at 7:57 AM, Brandon Reeves <[email protected] >> <mailto:[email protected]>> wrote: >> >>> I am new to monit so please link if this has been solved. >>> >>> >>> The scenario. We are monitoring a process with monit currently. If the >>> service stops, we want monit to attempt to restart the service x times, >>> then run a shell script. If the process stays down, we would like monit to >>> perform an additional action, say run another script, reboot, etc. however >>> if the script comes up we need a different script to be run. >>> >>> >>> Is this possible? >>> >>> >>> Thanks >>> >>> Brandon >>> >>> -- >>> To unsubscribe: >>> https://lists.nongnu.org/mailman/listinfo/monit-general >>> <https://lists.nongnu.org/mailman/listinfo/monit-general>-- >> To unsubscribe: >> https://lists.nongnu.org/mailman/listinfo/monit-general >> <https://lists.nongnu.org/mailman/listinfo/monit-general>-- > To unsubscribe: > https://lists.nongnu.org/mailman/listinfo/monit-general
-- To unsubscribe: https://lists.nongnu.org/mailman/listinfo/monit-general
