I am trying to do the following:

monit stop mysqld
monit: Cannot connect to the monit daemon. Did you start it with http support?

it only works when I stop the monit service.

Do you have any suggestions?

  • Please post your entire monit config. – ewwhite Mar 26 '12 at 12:29

Make sure you have embedded web server enabled. This monit stop ... command uses it internally.

# Monit has an embedded web server which can be used to view status of 
# services monitored and manage services from a web interface. See the
# Monit Wiki if you want to enable SSL for the web server. 

set httpd port 2812 and
    use address localhost  # only accept connection from localhost
    allow localhost        # allow localhost to connect to the server and
    allow admin:monit      # require user 'admin' with password 'monit'

Do change password if you omit this "use address localhost" line.

| improve this answer | |

Please post your monit config. The monit stop process references the name of the process defined in the configuration stanza. So if you have a config entry for MySQL, it should look like check process mysql with pidfile...

Your monit stop command should use the same name as the word following "process" in the configuration file.

| improve this answer | |
  • set daemon 5 # Include all files from /etc/monit.d/ include /etc/monit.d/* check process mysqld with pidfile /var/run/mysqld/mysqld.pid group database start program = "/etc/init.d/mysqld start" stop program = "/etc/init.d/mysqld stop" if failed host port 3306 protocol mysql then exec /usr/lib/heartbeat/hb_standby local – edotan Mar 26 '12 at 12:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.