Hi asurti, as far as I understand Monit this is the expected behavior as each check is "granular". I would use an exec statement to restart the services like this
check file checkFile with path pathToFile if timestamp > 4 minute for 8 cycles then exec "for $s in fooBar fooBar1 fooBar2; do service $s restart; done" Kind regards, Dr. Marco Roose -----Original Message----- From: monit-general [mailto:[email protected]] On Behalf Of asurti Sent: Tuesday, December 12, 2017 3:39 PM To: [email protected] Subject: Application failed to start after timestamp check failed in monit I am having a simple monit control file which contains the following /check process fooBar1 with pidfile fooBar1PidFile start program = "/etc/init.d/fooBar1 start" with timeout 10 seconds stop program = "/etc/init.d/fooBar1 stop" if 5 restarts within 5 cycles then unmonitor check process fooBar2 with pidfile fooBar2PidFile start program = "/etc/init.d/fooBar2 start" with timeout 10 seconds stop program = "/etc/init.d/fooBar2 stop" if 5 restarts within 5 cycles then unmonitor check process fooBar with pidfile fooBarPidFile start program = "/etc/init.d/fooBar start" with timeout 10 seconds stop program = "/etc/init.d/fooBar stop" if 5 restarts within 5 cycles then unmonitor if memory usage > 25.0 MB for 4 cycles then alert depends on fooBar1 depends on fooBar2 depends on checkFile check file checkFile with path pathToFile if timestamp > 4 minute for 8 cycles then restart/ Here the intention is to restart fooBar, fooBar1 and fooBar2 applications when the timestamp check for checkFile fails. But what actually happens is it tries to restart the checkFile instead of fooBar. This check was working fine with monit version 5.5, but not working with 5.18. This is what I am getting when timestamp fails and after that 8 cycles are elapsed. / 'checkFile' timestamp for pathToFile failed -- current timestamp is Fri, 08 Dec 2017 12:47:04 'fooBar' failed to start -- could not start required services: 'checkFile' 'fooBar' start action failed / Am I missing something here? Thanks in advance -- Sent from: http://nongnu.13855.n7.nabble.com/monit-general-f4.html -- To unsubscribe: https://lists.nongnu.org/mailman/listinfo/monit-general
smime.p7s
Description: S/MIME cryptographic signature
-- To unsubscribe: https://lists.nongnu.org/mailman/listinfo/monit-general
