Monit Configuration

Published: by Creative Commons Licence

cassandra
check process cassandra with pidfile /var/run/cassandra/cassandra.pid
start program = "/etc/init.d/cassandra start"
stop program = "/etc/init.d/cassandra stop"

vsftpd
check process vsftpd
matching vsftpd
start program = "/etc/init.d/vsftpd start"
stop program = "/etc/init.d/vsftpd stop"

mysql
check process mysqld with pidfile /var/run/mysqld/mysqld.pid
group database
group mysql
start program = "/etc/init.d/mysql start"
stop program = "/etc/init.d/mysql stop"
if failed host localhost port 3306 protocol mysql with timeout 15 seconds for 3 times within 4 cycles then restart
if failed unixsocket /var/run/mysqld/mysqld.sock protocol mysql for 3 times within 4 cycles then restart
if 5 restarts with 5 cycles then timeout
depend mysql_bin
depend mysql_rc

check file mysql_bin with path /usr/sbin/mysqld
group mysql
include /etc/monit/templates/rootbin

check file mysql_rc with path /etc/init.d/mysql
group mysql
include /etc/monit/templates/rootbin

rabbitmq
check process rabbitmq with pidfile /var/run/rabbitmq.pid
start program = "/etc/init.d/rabbitmq-server start"
stop program = "/etc/init.d/rabbitmq-server stop"

fail2ban
check process fail2ban with pidfile /var/run/fail2ban/fail2ban.pid
group services
start program = "/etc/init.d/fail2ban force-start"
stop program = "/etc/init.d/fail2ban stop"
if failed unixsocket /var/run/fail2ban/fail2ban.sock then restart
if 5 restarts within 5 cycles then timeout

check file fail2ban_log with path /var/log/fail2ban.log
if match "ERROR|WARNING" then alert

greenbone
check process greenbone with pidfile /var/run/gsad.pid
start program "/etc/init.d/greenbone-security-assistant start"
stop program "/etc/init.d/greenbone-security-assistant stop"
if failed port 80 then restart

nessusd
check process nessusd with pidfile /opt/nessus/var/nessus/nessus-service.pid
start program "/etc/init.d/nessusd start"
stop program "/etc/init.d/nessusd stop"
if failed port 8834 then restart

openvasmd
check process openvasmd with pidfile /var/run/openvasmd.pid
start program "/etc/init.d/openvas-manager start"
stop program "/etc/init.d/openvas-manager stop"
if failed port 9390 then restart

openvassd
check process openvassd with pidfile /var/run/openvassd.pid
start program "/etc/init.d/openvas-scanner start"
stop program "/etc/init.d/openvas-scanner stop"
if failed port 9391 then restart

yule
check process yule with pidfile /var/run/yule.pid
start program "/etc/init.d/yule start"
stop program "/etc/init.d/yule stop"
if failed port 49777 then restart