#
# monitoring mongod
#

# monitor service
check process mongod with pidfile /var/run/mongod.pid
	start program = "/usr/sbin/service mongod start" with timeout 20 seconds
	stop program  = "/usr/sbin/service mongod stop"
	if 3 restarts within 5 cycles then exec "/opt/bertin/mediacentric/bin/monit_alert_restart.sh mongod" repeat every 1 cycle
	
check file mongodb_log with path /var/log/mongodb/mongod.log
	if match "No space left on device falling back" then exec "/opt/bertin/mediacentric/bin/services_interrupter.sh -s mongod 'mongodb logs : No space left on device falling back'" repeat every 1 cycle