Zabbix MySQL.running-slave item fails with MySQL 5.6

Bug #1272358 reported by Grégoire Morpain
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Monitoring Plugins
Fix Released
Medium
Unassigned

Bug Description

In the get_mysql_stats_wrapper.sh script the following command is executed to check if the SQL Slave is running:

if [ "$ITEM" = "running-slave" ]; then
    # Check for running slave
    RES=`mysql -e 'SHOW SLAVE STATUS\G' | egrep 'Slave_IO_Running:|Slave_SQL_Running:' | awk -F: '{print $2}' | tr '\n' ','`
    if [ "$RES" = " Yes, Yes," ]; then
        echo 1
    else
        echo 0
    fi
    exit
...

It appears that a field was added with MySQL 5.6 which make this test fail.

(http://dev.mysql.com/doc/refman/5.6/en/show-slave-status.html)
Slave_SQL_Running_State :
The state of the SQL thread (analogous to Slave_IO_State). The value is identical to the State value of the SQL thread as displayed by SHOW PROCESSLIST; Section 8.12.5.7, “Replication Slave SQL Thread States”, provides a listing of possible states. This field was added in MySQL 5.6.0.

As you can see:

MySQL 5.5 >
mysql -e "SHOW SLAVE STATUS\G" | egrep 'Slave_IO_Running|Slave_SQL_Running'
             Slave_IO_Running: Yes
            Slave_SQL_Running: Yes

MySQL 5.6 >
mysql -e "SHOW SLAVE STATUS\G" | egrep 'Slave_IO_Running|Slave_SQL_Running'
             Slave_IO_Running: Yes
            Slave_SQL_Running: Yes
      Slave_SQL_Running_State: Slave has read all relay log; waiting for the slave I/O thread to update it

Revision history for this message
Roman Vynar (roman-vynar) wrote :

Quick fix until it is released:

- RES=`mysql -e 'SHOW SLAVE STATUS\G' | egrep 'Slave_IO_Running|Slave_SQL_Running' | awk -F: '{print $2}' | tr '\n' ','`
+ RES=`mysql -e 'SHOW SLAVE STATUS\G' | egrep '(Slave_IO_Running|Slave_SQL_Running):' | awk -F: '{print $2}' | tr '\n' ','`

Changed in percona-monitoring-plugins:
importance: Undecided → Medium
status: New → Fix Committed
Changed in percona-monitoring-plugins:
milestone: none → 1.1.2
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.