Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I'm 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.

any suggestions?

Thanks!! E.

share|improve this question
    
Please post your entire monit config. –  ewwhite Mar 26 '12 at 12:29

2 Answers 2

up vote 3 down vote accepted

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.

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

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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