Add user info to the max_duration check of pmp-check-mysql-innodb

Bug #1185513 reported by Christopher Bowman
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Monitoring Plugins
Fix Released
Medium
Unassigned

Bug Description

Having only the thread id makes gathering data from the past hard.

Something like the following would work:

=== modified file 'nagios/bin/pmp-check-mysql-innodb'
--- nagios/bin/pmp-check-mysql-innodb 2012-06-11 10:54:55 +0000
+++ nagios/bin/pmp-check-mysql-innodb 2013-05-29 16:20:26 +0000
@@ -98,7 +98,7 @@
          OPT_CRIT=${OPT_CRIT:-600}
          LEVEL=$(mysql_exec "
             SELECT UNIX_TIMESTAMP() - UNIX_TIMESTAMP(trx_started),
- trx_mysql_thread_id
+ concat(IFNULL((select concat(user, '@', host) from INFORMATION_SCHEMA.PROCESSLIST where id = trx_mysql_thread_id),'UNKNOWN'),'(',trx_mysql_thread_id,')')
             FROM INFORMATION_SCHEMA.INNODB_TRX
             ORDER BY trx_started LIMIT 1" 2>"${TEMP}")
          if [ "$?" != 0 ]; then
@@ -135,7 +135,7 @@
             NOTE="${LEVEL:-UNKNOWN} transactions in LOCK WAIT status"
             ;;
          max_duration)
- NOTE="longest transaction active for ${LEVEL:-UNKNOWN} seconds (thread ${THD:-unknown})"
+ NOTE="longest transaction active for ${LEVEL:-UNKNOWN} seconds (user@host:port(thread) ${THD:-unknown})"
             ;;
       esac
       if [ "${LEVEL:-0}" -gt "${OPT_CRIT}" ]; then

Tags: nagios
tags: added: nagios
Changed in percona-monitoring-plugins:
status: New → Confirmed
importance: Undecided → Low
Changed in percona-monitoring-plugins:
importance: Low → Medium
Changed in percona-monitoring-plugins:
status: Confirmed → Fix Committed
Changed in percona-monitoring-plugins:
milestone: none → 1.0.4
Changed in percona-monitoring-plugins:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.