monit-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem to monitor MySQL


From: Martin Pala
Subject: Re: Problem to monitor MySQL
Date: Mon, 12 Sep 2005 18:21:50 +0200
User-agent: Mozilla Thunderbird 1.0.6 (Windows/20050716)

bosco wrote:
Hi,

my configuration :

check process mysqld with pidfile /var/run/mysqld/mysqld.pid
  start program = "/etc/init.d/mysqld start"
  stop program = "/etc/init.d/mysqld stop"
  if failed host 127.0.0.1 port 3306 then restart

In the case that mysql is realy listening on 127.0.0.1:3306, you can use mysql protocol test:

  if failed host 127.0.0.1 port 3306 protocol mysql then restart
                                     ^^^^^^^^^^^^^^

Mysql can drop the connection when you will use just tcp connect test (without the 'protocol mysql' part as in your example above).

This performs mysql ping when anonymous user is supported or in the case that the anonymous user is not allowed to connect, the authentication failure is viewed as the mark that the mysql server works.

  if cpu is greater than 60% for 2 cycles then alert
  if cpu > 80% for 5 cycles then restart
  if children > 100 then restart
  if loadavg(5min) greater than 50 for 8 cycles then restart
  if 3 restarts within 5 cycles then timeout
  alert address@hidden
  group server

Monit version : 4.5.1

i don't have monit log. What must i use to have them ?

See monit documentation.

For example to enable logging via syslog add to the monit control file:

  set logfile syslog

or to log directly to some file use for example:

  set logfile /var/log/monit.log

You can also use debug mode (start monit with -v option).

You should also check mysql logs - you can enable the error logging for example by adding following to the my.cnf:

log-error = /var/log/mysqld.log

or even query log:

log = /var/log/mysqld-query.log


Martin




reply via email to

[Prev in Thread] Current Thread [Next in Thread]