MySQL test caused Aborted_connect

Issue #54 resolved
Cyril Beslay
created an issue

Hi,

In my configuration of Monit, i test MySQL with this lines :

check process mysqld with pidfile /var/run/mysqld/mysqld.pid
group database
start program = "/etc/init.d/mysql start"
stop program = "/etc/init.d/mysql stop"
if failed host 127.0.0.1 port 3306 protocol mysql then restart
if 5 restarts within 5 cycles then timeout

But, i've configured my server to not allow anonymous connections. So my server respond an Access Denied to Monit, wich is considered like a Success. I'm ok with that.

But, each time, MySQL detects an Aborted_connect and increments this variable. Is it possible to give user:password in configuration to test connection to MySQL ?

Comments (8)

  1. Cyril Beslay reporter

    Same problem with monit 8.1. Closing MySQL connection works when authentication suceed first. In my case, anonymous connections are forbidden (i used mysql_secure_installation) and check of Monit cause an Aborted_connect because requestLogin (line 88 of mysql.c) cause Access Denied.

  2. Michael Bakker

    I can confirm this "problem". I have also an addition to this behaviour:

    It appears to me that monit is not trying to use an anonymous login - as its stated in the documentation - instead its using the username "M". I have enabled anonymous login - by adding an emtpy username with empty password to the database - and monit was still not able to login according to mysql logfile. When adding user "M" with an empty password the mysql login for monit was successful.

    It would be really comfortable if we could supply an username and password for the mysql protocol.

  3. Tildeslash repo owner

    Fix #54 - Modified MySQL protocol test to simply connect to MySQL and read the server handshake packet. No anonymous login attempt is performed so the server does not log this as a failed login attempt if anonymous login is turned off (recommended).

    → <<cset e0f5940b4759>>

  4. Log in to comment