Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Monit process 'mysql' Not Monitored

Any ideas why monit will not monitor mysql in this setup??? I've gone through everything I can find here to solve the problem to no avail.

These are my versions:

Distributor ID: Ubuntu
Description:    Ubuntu 14.04.2 LTS
Release:    14.04
Codename:   trusty
mysql --version
Ver 14.14 Distrib 5.5.41, for debian-linux-gnu (x86_64) using readline 6.3
monit -V
This is Monit version 5.6

I've tried both of these setups:

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 protocol mysql then restart
    if failed unixsocket /var/run/mysqld/mysqld.sock protocol MYSQL then restart

And get this:

monit status
Process 'mysql'
  status                            Not monitored
  monitoring status                 Not monitored

Can confirm:

/var/run/mysqld/mysqld.pid

reads the same as

ps -e | grep "mysql"

Log:

/var/log/monit.log

shows no errors

Monit is running as root:

ps -eaf | grep monit
root      4549     1  0 05:18 ?        00:00:00 /usr/bin/monit -c /etc/monit/monitrc
root      5248 12440  0 05:53 pts/0    00:00:00 grep --color=auto monit
like image 400
shaone Avatar asked Mar 12 '15 09:03

shaone


People also ask

How do I monitor monit?

How to monitor? Monit is controlled via an easy to configure control file with a simple syntax. The file is called monitrc and resides in your home directory. An example monitrc file is included with the Monit download.

How often does monit check?

By default, it is set up to check that services are running every 2 minutes and stores its log file in “/var/log/monit.

How do I restart monit service?

Now, If we want Monit to also start at boot so I need to edit the service configuration file at /etc/default/monit and ensure “START” is set to “yes”. And that's it. It will automatically restart any service or script.


1 Answers

as already mentioned, this should do:

monit monitor mysql

sometimes the "timeout" statement can disable monitoring in case of too many restart errors, I do not recommend using statements like this:

if X restarts within Y cycles then timeout
like image 83
riba Avatar answered Oct 02 '22 07:10

riba