Monitor MySql with Zabbix

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

(you will find at almost the end of file:

Include =/etc/zabbix/zabbix_agentd.d/)

Check where your zabbix_mysql config is:

# 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:



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: