#
# monitoring mongodb - debian stretch
#

# monitor service
check process mongodb with pidfile /var/lib/mongodb/mongod.lock
        start program = "/usr/sbin/service mongodb start" with timeout 20 seconds
        stop program  = "/usr/sbin/service mongodb stop"
        if 5 restarts within 5 cycles then exec "/opt/bertin/mediacentric/bin/monit_alert_restart.sh mongodb" repeat every 1 cycle

check file mongodb_log with path /var/log/mongodb/mongodb.log
        if match "No space left on device falling back" then exec "/opt/bertin/mediacentric/bin/services_interrupter.sh -s mongodb 'mongodb logs : No space left on device falling back'" repeat every 1 cycle