check_log + mysqld.log

Gerhard Lausser Gerhard.Lausser at consol.de
Mon Dec 10 11:14:43 CET 2007


Hi Roger,

> I don't know much about MySQL to know which types of errors that I should
be looking for and am hoping others here might have some recipes / hacks
that they use that they might share what has worked well for them. 

if you use check_logfiles instead of check_log, you can squeeze multiple
patterns to look for in a service. You call it with a configuration file
which for example looks like this:

@searches = (
{
  tag => 'mysqlerr',
  logfile => '/var/log/mysql/mysql.log',  # wherever your logfile is
  rotation => 'mysql\.log\.old',          # must match the rotated
logfile(s)
  criticalpatterns => [
    'Error',
    'you hit a bug',
    'Disk is full',
    'find out where mysqld died',
    'Number of processes running now: 0',

  ],
  warningpatterns => [
    'should be repaired',
    'try to repair it',
    'InnoDB: Database was not shut down normally'
  ],
},
{
  tag => 'mysqlrecover',
  logfile => '/var/log/mysql/mysql.log',
  rotation => 'mysql\.log\.old',
  criticalpatterns => [
    'InnoDB: Starting crash recovery',
  ],
  okpatterns => [
    'InnoDB: Apply batch completed'
  ]  
}
);


> And where check_log didn't work (say you needed more "intelligent log
watching"), 
I don't know if this can already be called "intelligence", but in the last
lines you can see an example for a so-called okpattern which is able to
remedy a criticalpattern found shortly before. Another feature is the
possibility to call external scripts or a perl subroutine if specific
patterns are found. This could be used to automatically restart mysqld or
maybe automatically repair tables.
You can find it at http://www.consol.com/opensource/nagios/check-logfiles

Greetings from Munich,
Gerhard


-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list