This article covers how to fix Zabbix error, an invalid entry when restarting the zabbix-agent which may appear when the configuration file is placed in the wrong path.
The problem is with the configurations:
You are putting the .my.cnf file at the wrong place.
Zabix agent configuration file has prescribed format and parameters defined.
If you may use Include option to load additional config files, be sure it follows the same format.
So, in your case the .my.cnf file fails to load when you put it under /etc/zabbix/zabbix_agentd.d.
You are missing the part to configure userparameter_mysql.conf file properly.
To resolve this Zabbix error:
1. Move the .my.cnf file from /etc/zabbix/zabbix_agentd.d directory to /etc/zabbix.
And also remove any Include entry to refere to the .my.cnf file (if there is any).
The content of the file may look like this:
2. Please make sure that the user listed here exists and have the necessary permissions in mysql.
3. Edit /etc/zabbix/zabbix_agentd.d/userparameter_mysql.conf file: You need to replace HOME=/var/lib/zabbix with HOME=/etc/zabbix to point to the right file (should appear three times) as mentioned in the first line of the file.
4. Finally restart the agent: $ service zabbix-agent restart