Database Monitoring Setup MySQL/MariaDB Using Zabbix Server

Tram Ho

Continuing the series about zabbix, in this article I will show you how to monitor MySQL/MariaDB with Zabbix.

Before going into the MySQL/MariaDB monitoring setup, you need to make sure that the zabbix agent is installed on the server.

Configuration Guide

Step 1: Configure MySQL/MariaDB

Create a new user, here I create a user named zabbix, and grant permissions for it

Step 2: Create file .my.cnf

You need to create a .my.cnf file in the home path of zabbix /var/lib/zabbix, declare the following information:

then paste the following content into the file .my,cnd

Step 3: Check the configuration in the file zabbix_agentd.conf

Now we will check if the following line is uncommented in the /etc/zabbix/zabbix_agentd.conf file (if not, add it)

Step 4: Create the file userparameter_mysql.conf Next, inside the directory /etc/zabbix/zabbix_agent.d/ there will be a file userparameter_mysql.conf. If not, recreate this file and add the following content:

Note: Remember to pay attention to find the right monitor template according to the version of mysql and zabbix, the template above is testing for mysql version 5.6 and zabbix server 5.0

Step 5: Now restart zabbix agent

Step 6: Add Host and select MySQL/MariaDB template

Access the zabbix server interface, select Configuration >> Host >> Create Host image.png

Select MySQL DB template image.png

After filling in the necessary information as shown above, click Add to complete.

Share the news now

Source : Viblo