3

Just in case if you are using Monit version 5.1.1 and try to monitor mysql with sock it will always fail with "Connection failed"

my monit configuration file is:

check process mysql with pidfile /var/lib/mysql/mysql.pid
   group database
   start program = "/etc/init.d/mysql start"
   stop program = "/etc/init.d/mysql stop"
   if failed unixsocket /var/lib/mysql/mysql.sock protocol MYSQL then restart
   if 5 restarts within 5 cycles then timeout

The logs was not showing any clear error and all posts in internet was about using TCP to mysql.

The solution that I found was to upgrade monit to 5.6, after the upgrade monit will be able to monitor mysql sock without any issue.

Using: CentoOS 6 Monit 5.1.1-4.el6 from repository epel

AFT
  • 131
  • 1
  • 4
  • BTW: this is not a question, I just want to post the issue and the solution for any CentOS user, it seems I will not be able to mark it as answered, I have to wait for 10 hours :( – AFT Oct 02 '13 at 18:56
  • Are you using MySQL 5.5? That would make sense since the monit changelog states for 5.2.3: `* Mysql protocol test supports mysql 5.5.x and newer now.` –  Oct 02 '13 at 22:00
  • Yes I'm using MySQL 5.5 – AFT Oct 04 '13 at 02:20

1 Answers1

0

The solution that I found was to upgrade monit to 5.6, after the upgrade monit will be able to monitor mysql sock without any issue.

Note: Also please check Yoonix comment regarding Monit support for MySQL 5.5

AFT
  • 131
  • 1
  • 4