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