Setup MySQL Database Monitoring
Video Lecture
Description
Our Zabbix Server is using a MySQL database. We can monitor this database using the Template DB MySQL by Zabbix agent
template.
After linking this template to your host, it will not work unless you do several more configurations.
Create a new file in the folder /etc/zabbix/zabbix_agentd.d/ and name it template_db_mysql.conf
1 |
|
Copy in this text below. See template_db_mysql.conf for official source code.
1 2 3 4 5 6 7 |
|
Log into mysql and create a new user called zbx_monitor and grant it the required permissions for the database server.
1 |
|
1 2 |
|
To verify the databases that you user has been added, you can type
1 |
|
Next, create a file called .my.cnf in home directory of Zabbix agent for Linux (/var/lib/zabbix by default )
or my.cnf in c:\ in Windows.
and add the contents below
1 2 3 |
|
Note
On linux, you may need to create the folder /var/lib/zabbix using the command mkdir /var/lib/zabbix
and then cd into it.
Save and restart the zabbix agent.
1 |
|
After a minute or so, your new MySQL items for your Host will start to receive data.