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

can someone please steer me in the right direction. I'm completely new to Monit, set it up, everything working fine, but I'm having a problem with mysql.

This is the set up in my conf file:

check process mysql with pidfile /var/run/mysqld/mysqld.pid
group database
start program = "/etc/init.d/mysql start"
stop program = "/etc/init.d/mysql stop"
if failed host 127.0.0.1 port 3306 then restart
if 5 restarts within 5 cycles then timeout

But when I try to enable monitoring, it just wont have it. Checked my log files:

monit[8199]: 'mysql' process is not running 
monit[8199]: 'mysql' trying to restart
monit[8199]: 'mysql' start: /etc/init.d/mysql
monit[8199]: 'mysql' failed to start

I've looked for the mysqld.pid file in that path, but all that's present is mysqld.sock.. Not sure if this has something to do with it. Hope someone can help, cheers!

share|improve this question
add comment

1 Answer 1

it seems your configuration is ok.

Does your Mysql run in normal conditions ? Can you try in console as root:

/etc/init.d/mysql start

If not you must solve the start problem first, then try to test the configuration.

Another problem could be permissions, try removing the line:

group database

I hope this help you.

share|improve this answer
    
Hi thanks for your reply. When I run /etc/init.d/mysql start it always gives: Rather than invoking init scripts through /etc/init.d, use the service(8) utility, e.g. service mysql start Since the script you are attempting to invoke has been converted to an Upstart job, you may also use the start(8) utility, e.g. start mysql - Hmm, strange..I've removed group database too.. still not liking it –  williamsowen May 19 '11 at 15:36
1  
Just restarted! It's working, I removed group database and added pid-file=/var/run/mysqld/mysqld.pid to my.cnf - something did the trick, cheers!! –  williamsowen May 19 '11 at 15:46
add comment

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.