GNU/Linux >> Tutoriales Linux >  >> Cent OS

Instalar y configurar Monit en CentOS 8 / RHEL 8

Monit es una herramienta de monitorización de procesos que vigila servicios y puede reiniciarlos automáticamente si fallan. También monitoriza archivos, directorios, sistemas de archivos y conexiones TCP/IP.

Instalar Monit

dnf install -y git gcc glibc make glibc-devel kernel-headers autoconf automake libtool bison flex libzip-devel pam-devel openssl openssl-devel
git clone https://bitbucket.org/tildeslash/monit.git
cd monit
./bootstrap
./configure
make
make install

Configurar Monit

cp monitrc /etc/
vi /etc/monitrc

Ajusta el intervalo de comprobación, el servidor de correo y el archivo de log. Para la interfaz web, habilita el puerto 2812:

set httpd port 2812 and use address 0.0.0.0
allow 0.0.0.0/0
allow admin:monit

Crea el servicio systemd y habilita Monit:

systemctl daemon-reload
systemctl start monit
systemctl enable monit

Abrir el firewall

firewall-cmd --permanent --add-port=2812/tcp
firewall-cmd --reload

Añadir servicios a monitorizar

Crea definiciones en /etc/monit.d/. Por ejemplo:

check process SysLog with pidfile /var/run/rsyslogd.pid
start program = "/usr/bin/systemctl start rsyslog.service"
stop program = "/usr/bin/systemctl stop rsyslog.service"

Comprueba la sintaxis y recarga:

monit -t
systemctl reload monit

Monit puede enviar alertas por correo cuando un servicio falla. Con esto tendrás un sistema de monitorización automática funcionando en CentOS 8 / RHEL 8.

Cent OS
  1. Cómo instalar phpMyAdmin en RHEL 8 / CentOS 8

  2. Cómo instalar P7Zip en RHEL 8 / CentOS 8

  3. Cómo instalar ntfs-3g en RHEL 8 / CentOS 8

  4. Cómo instalar Icinga 2 en CentOS 8 / RHEL 8

  5. Cómo instalar Monit Process Monitoring en CentOS 6

Cómo instalar cpan en RHEL 8 / CentOS 8

Instalar Ruby en RHEL 8 y CentOS 8 y ejecutar tu primer programa

Instalar Docker CE y docker-compose en RHEL 8 / CentOS 8

Instalar VirtualBox 6.0 en CentOS 8 / RHEL 8

Instalar PHP 7.4 en CentOS 8 / RHEL 8

Cómo instalar y configurar Monit en CentOS 7 / RHEL 7