我在 Ubuntu 14.04 上安装了 LEMP 和 MariaDB。我已安装并配置 Monit 来监控 php-fpm、mysqld 和 nginx,但这些服务似乎都没有受到监控,如下图所示:
我有想要在/etc/moninit/conf.d/
目录中监控的每个服务的配置文件,并使用以下行正确包含在 /etc/monit/monitrc 中:
include /etc/monit/conf.d/*
这是我的 Mysql 配置文件内容
check process mysqld with pidfile /var/run/mysqld/mysqld.pid
group database
group mysql
start program = "/etc/init.d/mysql start"
stop program = "/etc/init.d/mysql stop"
if failed host localhost port 3306 protocol mysql with timeout 15 seconds for 3 times within 4 cycles then restart
if failed unixsocket /var/run/mysqld/mysqld.sock protocol mysql for 3 times within 4 cycles then restart
if 5 restarts with 5 cycles then timeout
depend mysql_bin
depend mysql_rc
check file mysql_bin with path /usr/sbin/mysqld
group mysql
include /etc/monit/templates/rootbin
check file mysql_rc with path /etc/init.d/mysql
group mysql
include /etc/monit/templates/rootbin
答案1
最后还是自己解决了。原因如下:
sudo monit monitor all
问题解决了。