Mysql – Check thesql slow queries

icingamonitoringMySQLnagios

Is it possible to monitor mysql like:

  • if some queries run more then 300 seconds – it will be warning
  • if some queries run more then 500 seconds – it will be critical

I tried:

/usr/lib/nagios/plugins/check_mysql_health --hostname localhost --username icinga --password XXX --mode slow-queries --warning 300

But this only shows the rate slow_queries/per second. How can I monitor mysql as I describe?

Thank you for your help.

Br,

Best Answer