check_mysql_health plugin slow query alert escape condition

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
niraj_vara
Posts: 20
Joined: Thu Dec 13, 2012 1:38 am

check_mysql_health plugin slow query alert escape condition

Post by niraj_vara »

Hi

I have Nagios Core 3.4.4 installed on centos 6. I have installed the plugin check_mysql_health.

I have configure check_mysql_health for slow query alert for mysql. and configuration is as below.

@ nagios server side

Code: Select all

 define service{
     use                             generic-service,graphed-service         ; Name of service template to use
     host_name                       xyzdb
     service_description             slow-queries
     check_command                   check_mysql_slow!0.001!0.005!
      notifications_enabled            0
       check_command                 check_nrpe!check_mysql_health!10.0.0.197!repl!xyz@ab!0.001!0.005!slow-queries!
      contact_groups          admins,sms
}

@ server-monitore side (client)

Code: Select all

command[check_mysql_health]=/usr/local/nagios/libexec/check_mysql_health --hostname localhost --username repl --password xyz@ab --warning 0.003 --critical 0.005 -mode slow-queries

Its working fine but problem is its sending alert when my backup script run and its using the mysqldump command the following slow query entry during the backup script run. I want to skip this kind of alert

Code: Select all

use abc123;
SET timestamp=1415129789;
SELECT /*!40001 SQL_NO_CACHE */ * FROM `transaction_sent_emails`;
# Time: 141105  1:06:53
# User@Host: root[root] @  [10.0.0.166]
# Query_time: 10.064926  Lock_time: 0.000000 Rows_sent: 18586  Rows_examined: 18586
use cde123;
SET timestamp=1415129813;
SELECT /*!40001 SQL_NO_CACHE */ * FROM `transaction_sent_emails`;
# Time: 141105  1:07:32
# User@Host: root[root] @  [10.0.0.166]
# Query_time: 3.166703  Lock_time: 0.000000 Rows_sent: 7107  Rows_examined: 7107
use Marketing;
SET timestamp=1415129852;
SELECT /*!40001 SQL_NO_CACHE */ * FROM `transaction_sent_emails`;
# Time: 141105  1:08:32
# User@Host: root[root] @  [10.0.0.166]
# Query_time: 11.785564  Lock_time: 0.000000 Rows_sent: 4994866  Rows_examined: 4994866
use ghi123;
SET timestamp=1415129912;
SELECT /*!40001 SQL_NO_CACHE */ * FROM `qcsEditValues`;
# Time: 141105  1:09:09
# User@Host: root[root] @  [10.0.0.166]
# Query_time: 5.427509  Lock_time: 0.000000 Rows_sent: 1652655  Rows_examined: 1652655
use xyz123;
SET timestamp=1415129949;
SELECT /*!40001 SQL_NO_CACHE */ * FROM `URLDataLink`;
# Time: 141105  5:02:16
# User@Host: root[root] @  [10.0.0.166]
# Query_time: 11.224886  Lock_time: 0.000046 Rows_sent: 2  Rows_examined: 121327

I want to avoid this kind of alert during which generated during backup. So Please guide for the same how to escape this alert in nagios.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: check_mysql_health plugin slow query alert escape condit

Post by tmcdonald »

If your backup is run on a set schedule, you could just exclude that time from the slow query check:

http://www.thegeekstuff.com/2013/09/nagios-timeperiod/
Former Nagios employee
Locked