How to configure the zabbix on the agent side to allow mysql data to populate in zabbix. Ssh to the server you want to monitor – the one with the zabbix agent installed on. Check that your zabbix_agent config file is including the path “/etc/zabbix/zabbix_agentd.d/”:
# nano /etc/zabbix/zabbix_agentd.conf
Look towards the the end of file:
Include=/etc/zabbix/zabbix_agentd.d/*.conf
Check where your zabbix_mysql config is:
# locate userparameter_mysql /usr/share/doc/zabbix-agent-4.4.5/userparameter_mysql.conf
Copy to he following directory:
cp /usr/share/doc/zabbix-agent-4.4.5/userparameter_mysql.conf /etc/zabbix/zabbix_agentd.d/userparameter_mysql.conf
Open the config file:
# nano /etc/zabbix/zabbix_agentd.d/userparameter_mysql.conf
Looks for this type of info…
UserParameter=mysql.status[*],echo "show global status where Variable_name='$1';" | HOME=/var/lib/zabbix mysql -N | awk '{print $$2}'
If you’ll find it for example: HOME=/var/lib/zabbix then create that directory if it does not exist:
# mkdir /var/lib/zabbix
change to that directory and create/edit .my.cnf file:
# cd /var/lib/zabbix # nano .my.cnf
add the following (assuming you have a user zabbix added with a password. Or, you can use any user as long as they have permissions:
[mysql] user=zabbix password=zabbixpassword host=localhost [mysqladmin] user=zabbix password=zabbixpassword host=localhost
Then save.
Restart mysql:
#systemctl restart mariadb.service
Restart zabbix agent:
#systemctl restart zabbix-agent.service
Now go to Monitoring – Latest Data to view mysql data.
Other Resources:
http://stackoverflow.com/questions/34805211/monitoring-mysql-with-zabbix-agent
http://blog.themilkyway.org/2013/11/how-to-monitor-mysql-using-the-new-zabbix-template-app-mysql/