[ZBXNEXT-9295] Add or extend templates for mysql 8.4 [Replica and Source] Created: 2024 Jul 02  Updated: 2025 Mar 26

Status: Open
Project: ZABBIX FEATURE REQUESTS
Component/s: Templates (T)
Affects Version/s: 6.0.31
Fix Version/s: None

Type: New Feature Request Priority: Major
Reporter: Janis Müller Assignee: Vjaceslavs Bogdanovs
Resolution: Unresolved Votes: 2
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

https://www.zabbix.com/de/integrations/mysql

Temlate DB MySql works on mysql 8.4, but discovery for replication stats are not working due to the removal of master and slave syntax in mysql 8.4. Important parameters that should be working. Any plans to update the template?



 Comments   
Comment by Janis Müller [ 2024 Jul 02 ]

to clarify, with "Temlate DB MySql works on mysql 8.4", I mean works to monitor that mysql version but lacking replication monitoring support

Comment by Vitalii Khutornyi [ 2025 Mar 12 ]

It's not just a template problem. I investigated the code of zabbix-agent2 and found that even in the latest versions only the “show slave status” command is used in the MySQL plugin code

Comment by Vitalii Khutornyi [ 2025 Mar 18 ]

The temporary fix for me it is build custom zabbix_agent2 with next fixes 

# Files to change
zabbix-src/src/go/plugins/mysql/
 handler_replication_status.go
 handler_replication_discovery.go

handler_replication_status.go (lines 26, 31)

.....
const masterKey = "Source_Host"
.....
         rows, err := conn.Query(ctx, `SHOW REPLICA STATUS`)
.....

handler_replication_discovery.go (lines 28, 39)

.....
         rows, err := conn.Query(ctx, `SHOW REPLICA STATUS`)
.....
                 res = append(res, map[string]string{"Source_Host": row["Source_Host"]})

Also the templates key values must be changed according to the new values from zabbix agent

 

Templates > MySQL Zabbix agent 2 > Discovery rules > Replication discovery > Item prototypes

item key value
MySQL: Replication Seconds Behind Master {#MASTER_HOST} mysql.replication.seconds_behind_source"{#MASTER_HOST}"
MySQL: Replication Slave IO Running {#MASTER_HOST} mysql.replication.replica_io_running"{#MASTER_HOST}"
MySQL: Replication Slave SQL Running State {#MASTER_HOST} mysql.replication.replica_sql_running_state"{#MASTER_HOST}"
MySQL: Replication Slave SQL Running {#MASTER_HOST} mysql.replication.replica_sql_running"{#MASTER_HOST}"

Be careful.
These changes are not backward compatible and will not work with MySQL versions that do not have “show replica status” command

Comment by Janis Müller [ 2025 Mar 18 ]

Thanks for the potential fix master2sid2 

I use zabbix_agent (v1) but it should be similar here.

Comment by Arda Beyazoglu [ 2025 Mar 26 ]

This started to become an important issue after upgrading to mysql 8.4 LTS. The issue affects all zabbix versions including 7.0 LTS. 

I think, the pllugins must check the mysql version, run appropriate command and then replace "replica" and "source" keywords with "slave" and "master" to support existing templates. This way only the plugin code changes, and nobody has to apply any migration.

Generated at Sat Aug 02 11:05:44 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.