MySQL test caused Aborted_connect

Issue #54 resolved
Cyril Beslay created an issue


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

check process mysqld with pidfile /var/run/mysqld/
group database
start program = "/etc/init.d/mysql start"
stop program = "/etc/init.d/mysql stop"
if failed host 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. Tildeslash repo owner


    please try Monit 5.8.1 ... Monit 5.7 and 5.8 aborted the connection on close, 5.8.1 performs graceful shutdown/close.

  2. 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.

  3. 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.

  4. Tildeslash repo owner

    Username 'M' comes from this patch we received. Fixed back to empty now. Adding the option to set username and password at will is noted

  5. 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>>

  6. Log in to comment