2

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?

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

2 Answers 2

4

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.

0

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.

1
  • 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 82.166.223.37 port 3306 protocol mysql then exec /usr/lib/heartbeat/hb_standby local
    – edotan
    Mar 26, 2012 at 12:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .