Zabbix agent complains when trying to start:
Starting Zabbix agent: zabbix_agentd [...]: ERROR: cannot add user parameter
"mysql.status[*],echo "show global status where Variable_name='$1';" |
HOME=/var/lib/zabbix mysql -N | awk '{print $$2}'": key "mysql.status"
already exists
The file has been copied almost exactly from the existing userparameter_mysql.conf which has been renamed.
The reason was I had renamed the old one instead of removing it and zabbix agent picked up the renamed file in addition to the new one.
Moving the backup file away solved the problem.
Easy enough but I had already googled it and seen a couple of others struggle without getting an answer before I realized this so I figured I better post it.
Another reason you might see this is that your editor software has created a backup userparameter file in the same directory that may be hidden. If you do a
grep -r "<your duplicate key name here>" *
from within the
/etc/zabbix/
folder you may find where else its defined. In my case it was nano that created it when my ssh session timed out before I exited the editor.