There are more steps than just simply adding the MySQL template to a host to get mysql monitoring working. We have to add additional information to the zabbix_agentd.conf file. This file is located at /usr/local/etc/zabbix_agentd.conf.
- Add the following to the end of the /usr/local/etc/zabbix_agentd.conf file:
- UserParameter=mysql.ping,HOME=/var/lib/zabbix mysqladmin ping | grep -c alive
- UserParameter=mysql.version,mysql -V
- You will then need to create the directory /var/lib/zabbix:
- mkdir /var/lib/zabbix
- chown zabbix /var/lib/zabbix
- chmod 700 /var/lib/zabbix
- Create a file called .my.cnf in /var/lib/zabbix and put in the following contents replacing $Mysql_Root_Password with the root password for mysql.
4. Then properly restrict access to that file.
- chown zabbix /var/lib/zabbix/.my.cnfchmod 600 /var/lib/zabbix/.my.cnf
- You then need to restart the zabbix agent
- service zabbix_agentd restart
We hope you find this article informative. Please share it with your friends, colleagues, and on all your favorite social sites. Let us know what interests you, and we will write it. Don’t forget to leave a comment.