Monit configs for web development
Jan 18, 2025 by Charly
Here is some configs I use for the linux monit tool
Note : edit the config file : /etc/monit/monitrc or create files in /etc/monit/config.d/...
Mysql
check process mysql with pidfile /run/mysqld/mysqld.pid
group mysql
if cpu > 50% for 5 cycles then alert
if totalmem > 800 MB for 5 cycles then alert
Nginx
check process nginx with pidfile /var/run/nginx.pid
if cpu is greater than 40% for 2 cycles then alert
Update waiting for system reboot
check file need_restart with path /var/run/reboot-required
if exist then alert
PHP-FPM
check process php7.4 with pidfile /var/run/php/php7.4-fpm.pid
check process php8.2 with pidfile /var/run/php/php8.2-fpm.pid
Network
check network network with interface eno1
if saturation > 90% then alert
Filesystem
check filesystem disk with path /
if SPACE usage > 90% then alert

Charly
Making the web better one site at a time, with a focus on performance and sustainability