「腾达签名」「腾达签名」

专注苹果签名难题
掉签问题一站解决

monit常用监控

a.监控nginx

vi /etc/monit.d/nginx.monit
check process nginx with pidfile /usr/local/nginx/nginx.pid
start program = "/usr/local/nginx/sbin/nginx"
stop program = "/usr/local/nginx/sbin/nginx -s stop"
if failed host 192.168.1.11 port 8011 protocol http then restart

b.监控memcached

vi /etc/monit.d/memcached.monit
check process memcached with pidfile /tmp/linuxjcq_memcached.pid
start program = "/etc/rc.d/init.d/memcached start"
stop program = "/etc/rc.d/init.d/memcached stop"
if failed host 192.168.1.10 port 11211 protocol memcache then restart

c.监控php-fpm

vi /etc/monit.d/php-fpm.monit
check process php-fpm with pidfile /usr/local/php/logs/php-fpm.pid
start program = "/usr/local/php/sbin/php-fpm start"
stop program = "/usr/local/php/sbin/php-fpm stop"
if cpu > 50% for 2 cycles then alert
if cpu > 70% for 5 cycles then restart
if failed host 192.168.1.10 port 9000 then restart
if 5 restarts within 5 cycles then timeout

d.监控mysql

vi /etc/monit.d/mysqld.monit
check process mysqld with pidfile /data/mysql/mysql.pid
start program = "/etc/init.d/mysqld start"
stop program = "/etc/init.d/mysqld stop"
if failed host 192.168.1.10 port 3306 then restart
if 5 restarts within 5 cycles then timeout 

苹果签名www.nanti.net

企业签名www.nanti.net

超级签名www.nanti.net

TF签名www.nanti.net

本原创文章未经允许不得转载 | 当前页面:「腾达签名」 » monit常用监控

评论