Saltar al contenido
La bitácora de FreeMEM by Francisco Tapias Bravo

Apuntes, proyectos, conocimiento libre y hacktivismo

1 min de lecturaAdministración de sistemas

Configuración de monit

Aquí dejo la configuración que he usado para monitorizar con Monit, los servicios Apache, MySql, ssh y el espacio de disco duro

check process apache with pidfile /var/run/apache.pid
start program = "/etc/init.d/apache start"
stop program  = "/etc/init.d/apache stop"
if failed host localhost port 80 protocol http
and request "/index.html" then restart
check device rootfs with path /dev/ubd0
if space usage > 3 GB then alert
check process mysql with pidfile /var/run/mysqld/mysqld.pid
group database
start program = "/etc/init.d/mysql start"
stop  program = "/etc/init.d/mysql stop"
if failed unix /var/run/mysqld/mysqld.sock then restart
if mem > 60 Mb then restart
if 5 restarts within 5 cycles then timeout
check process sshd with pidfile /var/run/sshd.pid
start program  "/etc/init.d/ssh start"
stop program  "/etc/init.d/ssh stop"
if failed port 22 protocol ssh then restart
if 5 restarts within 5 cycles then timeout

Comentarios

Deja un comentario

Los comentarios se moderan antes de publicarse. Tu correo solo sirve para contestarte: más en la política de privacidad.