#
# monitoring tomcat7
#

# Check service
check process tomcat7 with pidfile /var/run/tomcat7.pid
	start program = "/usr/sbin/service tomcat7 start" with timeout 20 seconds
	stop program  = "/usr/sbin/service tomcat7 stop"
	if 3 restarts within 5 cycles then exec "/opt/bertin/mediacentric/bin/monit_alert_restart.sh tomcat7"

# Check loggile for error messages
check file tomcat7_log with path /var/log/tomcat7/catalina.out
	if match "java.lang.OutOfMemoryError" then exec "/opt/bertin/mediacentric/bin/monit_alert_logs.sh tomcat7" repeat every 1 cycle
	if match "Too many open files" then exec "/opt/bertin/mediacentric/bin/monit_alert_logs.sh tomcat7" repeat every 1 cycle