Monit

O Monit é um programa linux utilizado para monitorar remotamente ou localmente serviços em servidores e registrar os eventos. Ele possui uma interface web que pode ser acessada via localhost.

Para checar os processos e restartá-los caso alguma coisa esteja errada, tais como aumento no consumo de memória, consumo exagerado de CPU etc.

Além de muitos recursos na configuração, ele possui três características que o faz melhor que seus similares: um sistema de alertas via email, um servidor http para acompanhar o sistema e, uma sintaxe de configuração bastante simples e completa.

image:http://mmonit.com/monit/

Instalar o Monit

#apt-get install monit

Configurar o Monit

#pico /etc/monit/monitrc

Desmarque as linhas abaixo, mude o usurário ou senha admin:monit (ou não):

set httpd port 2812 and use address localhost # only accept connection from localhost allow localhost # allow localhost to connect to the server and allow admin:monit # require user ‘admin’ with password ‘monit’ allow @monit # allow users of group ‘monit’ to connect (rw) allow @users readonly # allow users of group ‘users’ to connect readonly

salve o arquivo e saia (CTRL+O enter, CNTRL+X enter).

Acesse no browser http://localhost:2812

Argumentos Monit

start all

Start all services listed in the control file and enable monitoring for them. If the group option is set (-g).

start name

Start the named service and enable monitoring for it.

stop all

Stop all services listed in the control file and disable their monitoring.

stop name

Stop the named service and disable its monitoring.

restart all

Stop and start all services.

restart name

Restart the named service.

monitor all

Enable monitoring of all services listed in the control file.

monitor name

Enable monitoring of the named service. The name is a service entry name from the monitrc file. Monit will also enable monitoring of all services this service depends on.

unmonitor all

Disable monitoring of all services listed in the control file.

unmonitor name

Disable monitoring of the named service.

status

Print status information of each service.

summary

Print a short status summary.

reload

Reinitialize a running Monit daemon, the daemon will reread its configuration, close and reopen log files.

quit

Kill the Monit daemon process

validate

Check all services listed in the control file.

procmatch regex

Allows for easy testing of pattern for process match check.


Referencias:

  1. Mmonit Manual

2.Monit Doc