Zabbix 5.0:监控MySQL出现的问题

2022年01月14日 阅读数:4
这篇文章主要向大家介绍Zabbix 5.0:监控MySQL出现的问题,主要内容包括基础应用、实用技巧、原理机制等方面,希望对大家有所帮助。

升级到最新Zabbix 5.0.19后,出现 mysql.db.sizemysql.replication.get_slave_status监控键值报错:mysql

Invalid parameters: "TLSConnect" cannot be passed as a key parameter.

缘由分析

查询ZABBIX BUGS AND ISSUES 问题与错误,找到相似问题,以下:git

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.sql

修补程序12866d3f110 (26 Jul 2021) 引入了新的 MySQL 链接参数: TLS 加密。所以,监控键值mysql.db.sizemysql.repliation.get _ slave _ status如今须要7个参数,而不是以前的3个。问题是Template DB MySQL by Zabbix agent 2模板没有修补以符合更改项目的参数,致使最新版本的模板不能正常工做。bash

The problem exists since this commit. It changes the keys' parameter list, but only in zabbix-agent2 source code, not in the template.ui

image-20220112145052133

解决方法

修改Template DB MySQL by Zabbix agent 2模板中的监控键值:this

mysql.db.size["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}","","","","","{#DATABASE}"]
mysql.replication.get_slave_status["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}","","","","","{#MASTER_HOST}"]

截止目前,最新开发版本已修复该问题:加密