Zabbix 5.0:MySQL模板问题
Zabbix升级到5.0.17版本后,出现 mysql.db.size
和mysql.replication.get_slave_status
监控键值报错:
1 | Invalid parameters: "TLSConnect" cannot be passed as a key parameter. |
原因分析
查询ZABBIX BUGS AND ISSUES 问题与错误,找到类似问题,如下:
Patch 12866d3f110 (26 Jul 2021) has introduced new MySQL connection parameters: TLS encryption. Thus items “mysql.db.size” and “mysql.replication.get_slave_status” now require 7 parameters, not 3 as it was before.
Issue is “DB MySQL by agent 2” template was not patched to comply with changed items’ parameters. So, the latest version of template cannot work properly with zabbix-agent2 that has MySQL TLS encryption support
The fix is to add 4 empty parameters for TLS encryption to the items mentioned earlier.
修补程序12866d3f110 (26 Jul 2021) 引入了新的 MySQL 连接参数: TLS 加密。因此,监控键值mysql.db.size
和mysql.repliation.get _ slave _ status
现在需要7个参数,而不是之前的3个。问题是Template DB MySQL by Zabbix agent 2模板没有修补以符合更改项目的参数,导致最新版本的模板不能正常工作。
The problem exists since this commit. It changes the keys’ parameter list, but only in zabbix-agent2 source code, not in the template.
解决方法
修改Template DB MySQL by Zabbix agent 2
模板中的监控键值:
1 | mysql.db.size["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}","","","","","{#DATABASE}"] |
截止目前,最新开发版本已修复该问题:
- 5.0.18rc1: 332235f5578
- 5.4.8rc1: cb659e66e57
- 6.0.0alpha6 (master): c9b86f45c7e