[ZBX-18509] Problem with configuration MySQL plugin in configuration file. Invalid parameter Plugins.Mysql.Uri. Doesn't start Zabbix Agent 2 [version 5.0.4] Created: 2020 Oct 16  Updated: 2020 Nov 12  Resolved: 2020 Nov 12

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Agent2 plugin (G)
Affects Version/s: 5.0.4
Fix Version/s: 5.0.3

Type: Incident report Priority: Trivial
Reporter: Aleksejs Jevsejevs Assignee: Aigars Kadikis
Resolution: Cannot Reproduce Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

CentOS Linux release 8.2.2004 (Core)
Linux vpn_svc02 4.18.0-193.19.1.el8_2.x86_64 GNU/Linux

zabbix-agent2 x86_64 5.0.4-1.el8


Attachments: PNG File image-2020-10-16-14-30-45-444.png     Text File zabbix_agent2.log    

 Description   

Steps to reproduce:

Create MySQL user for monitoring.
Open the Zabbix Agent configuration file (zabbix_agent2.conf) and set the required parameters:

Plugins.Mysql.Uri=unix:/var/lib/mysql/mysql.sock
Plugins.Mysql.User=zabbix
Plugins.Mysql.Password='<password>'
DebugLevel=5

Start Zabbix Agent:

systemctl start zabbix-agent2.service

Zabbix Agent do not start. Attempts to start every 10 seconds. Show last Zabbix Agent log:

[Mysql] Start config validation...

log:

cannot create scheduling manager: invalid plugin Mysql configuration: Cannot assign configuration: invalid parameter Plugins.Mysql.Uri at line '<line number>': unknown parameter

Result:

Screenshot Zabbix Agent log:

 

P.S.

If do not use the MySQL plugin in configuration file, but add the monitoring user in macros {$MYSQL.USER} {$MYSQL.PASSWORD}, the template "Template DB MySQL by Zabbix agent 2" works.

 

Expected:

Launched Zabbix Agent

Fix:

In a downgraded version Zabbix Agent 2 (5.0.3), the plugin MySQL works.

 

dnf remove zabbix-agent2
Dependencies resolved.
Removing: zabbix-agent2 x86_64 5.0.4-1.el8 @zabbix 18 M
 
dnf install zabbix-agent2-5.0.3
Installing: zabbix-agent2 x86_64 5.0.3-1.el8 zabbix 4.9 M
yum list installed zabbix-agent2 
Installed Packages 
zabbix-agent2.x86_64          5.0.3-1.el8                 @zabbix

 



 Comments   
Comment by Aigars Kadikis [ 2020 Oct 26 ]

Starting with 5.0.4 the comment in config looks:

### Option: Plugins.Mysql.Sessions.*.Uri
#       Connection string. "*" should be replaced with a session name.
#
# Mandatory: no
# Range: Must matches the URI format.
# Default:
# Plugins.Mysql.Sessions.*.Uri=

### Option: Plugins.Mysql.Sessions.*.User
#       Username to be used for MySQL authentication. "*" should be replaced with a se
#
# Mandatory: no
# Default:
# Plugins.Mysql.Sessions.*.User=

### Option: Plugins.Mysql.Sessions.*.Password
#       Password to be used for MySQL authentication. "*" should be replaced with a se
#
# Mandatory: no
# Default:
# Plugins.Mysql.Sessions.*.Password=

Please follow this syntax:

Plugins.Mysql.Sessions.*.Uri=unix:/var/lib/mysql/mysql.sock
Plugins.Mysql.Sessions.*.User=zabbix
Plugins.Mysql.Sessions.*.Password=zabbix

BTW. You can pick stock zabbix_agent2.conf from latest 5.0 branch with:

curl "https://git.zabbix.com/projects/ZBX/repos/zabbix/raw/src/go/conf/zabbix_agent2.conf?at=refs%2Fheads%2Frelease%2F5.0" > /tmp/zabbix_agent2.conf

Let us if the issue resolved by using different settings.

Generated at Tue Jul 22 08:33:25 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.