Zabbix MySQL.running-slave item fails with MySQL 5.6
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Percona Monitoring Plugins |
Fix Released
|
Medium
|
Unassigned |
Bug Description
In the get_mysql_
if [ "$ITEM" = "running-slave" ]; then
# Check for running slave
RES=`mysql -e 'SHOW SLAVE STATUS\G' | egrep 'Slave_
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://
Slave_SQL_
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_
MySQL 5.6 >
mysql -e "SHOW SLAVE STATUS\G" | egrep 'Slave_
Slave_
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 |
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' ','` IO_Running| Slave_SQL_ Running) :' | awk -F: '{print $2}' | tr '\n' ','`
+ RES=`mysql -e 'SHOW SLAVE STATUS\G' | egrep '(Slave_