Search code examples
unixmonit

Cannot monitor MySQL in another system using Monit


I am trying to monitor the MySQL process in another system using Monit. The system is connected to the same network connection as mine. I am using this code (inside the configuration file, monitrc) :

check process mysql with pidfile /var/run/mysqld/mysqld.pid

group database

start program = "/etc/init.d/mysql restart"

stop program = "/etc/init.d/mysql stop"

if failed host 192.168.0.189 port 3306 then restart

if 5 restarts within 5 cycles then timeout

Status appears to be "Not monitored". What seems to be the problem?


Solution

  • Solved the problem. Had to change the bindaddress in my.conf file of mysql. Set it to 0.0.0.0 from localhost (127.0.0.1) to allow connections from all hosts in the network.