Hello, Using monit 5.4
I have a process check : Process Name = myappapi Group = myappapi Pid file = /home/myappapi/tomcat/tomcat.pid Monitoring mode = manual Start program = '/etc/init.d/myappapi start' timeout 60 second(s) Stop program = '/etc/init.d/myappapi stop' timeout 60 second(s) Existence = if does not exist 1 times within 1 cycle(s) then restart else if succeeded 1 times within 1 cycle(s) then alert Pid = if changed 1 times within 1 cycle(s) then alert Ppid = if changed 1 times within 1 cycle(s) then alert CPU usage limit = if greater than 80.0% 5 times within 5 cycle(s) then alert else if succeeded 1 times within 1 cycle(s) then alert Timeout = If restarted 5 times within 5 cycle(s) then unmonitor And a log file match check : File Name = myappgui-log Group = myappgui Path = /home/myappgui/tomcat/logs/catalina.out Monitoring mode = manual Existence = if does not exist 1 times within 1 cycle(s) then restart else if succeeded 1 times within 1 cycle(s) then alert Depends on Service = myappgui Pattern = if match "ERROR" 1 times within 1 cycle(s) then alert Pattern = if match "ERROR" 10 times within 10 cycle(s) then unmonitor Pattern = if match "OutOfMemoryError" 1 times within 1 cycle(s) then exec '/usr/bin/monit restart myappgui' timeout 0 cycle(s) Pattern = if match "OutOfMemoryError" 3 times within 10 cycle(s) then unmonitor Note that both are (thanks for you reply on that) in manual mode. The problem is that due to monit start <service> not being synchronous I'm using two commands : monit unmonitor <service> /etc/init.d/<service> stop and the other way around for starting. Problem is when doing unmonitoring the check that depends on the monitor is also unmonitored but no whe monitoring. Doing monit monitor <service> just monitors the service and not the log check that depends on it. I'm aware of -g option but if there's a way to avoid that i'd like to this way I can use the ansible monit module (which handles omnipotence). Thanks again for you help Alain -- View this message in context: http://nongnu.13855.n7.nabble.com/monit-monitor-service-doesn-t-monitor-depended-upon-checks-tp190862.html Sent from the monit-general mailing list archive at Nabble.com. -- To unsubscribe: https://lists.nongnu.org/mailman/listinfo/monit-general
