Detecting slow queries in MySQL using check_mysql_health

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
kaushalshriyan
Posts: 119
Joined: Fri May 22, 2015 7:12 am

Detecting slow queries in MySQL using check_mysql_health

Post by kaushalshriyan »

Hi,

Can somebody please help me understand how check_mysql_health Nagios plugin work. I am referring to https://labs.consol.de/nagios/check_mys ... index.html

For example :-

command[check_slow_queries]=/usr/lib64/nagios/plugins/check_mysql_health --hostname localhost --username admin --password admin --socket /var/lib/mysql/mysql.sock --warning 10 --critical 20 --mode slow-queries

Code: Select all

  
  Keyword	                                 Description	                              Range
slow-queries	             Rate of queries that were detected as “slow”           0..n/sec (0.1, 1)
Does check_mysql_health nagios plugin read the /var/lib/mysql/mysql.sock file to detect slow queries in MySQL DB server or does it use SHOW GLOBAL STATUS command as mentioned in https://dev.mysql.com/doc/refman/5.7/en ... ables.html?

Any explanation will be highly appreciable. Thanks in Advance.

Regards,

Kaushal
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: Detecting slow queries in MySQL using check_mysql_health

Post by tgriep »

I took a quick look at the plugin and is looks like it is running this for slow queries.

Code: Select all

SHOW STATUS LIKE 'Slow_queries'
This is the description of that query.
https://dev.mysql.com/doc/refman/5.7/en ... ow_queries
Be sure to check out our Knowledgebase for helpful articles and solutions!
kaushalshriyan
Posts: 119
Joined: Fri May 22, 2015 7:12 am

Re: Detecting slow queries in MySQL using check_mysql_health

Post by kaushalshriyan »

Thanks tgriep for the explanation
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Detecting slow queries in MySQL using check_mysql_health

Post by tmcdonald »

Did you have any further (related) questions or are we okay to close this thread?
Former Nagios employee
Locked