Sidebar

manual:config:templates_out_of_the_box:requirements:mysql

Requirements for MySQL by Zabbix agent template

Overview

This section contains the required steps to ensure proper operation of Template DB MySQL by Zabbix agent, developed for monitoring DBMS MySQL and its forks (such as MariaDB, etc.) by Zabbix agent. For monitoring MySQL by ODBC see requirements for the MySQL by ODBC template.

The template doesn't support monitoring of the multi-master replications.

Steps

1. Install Zabbix agent and MySQL client.

If necessary, add the path to the mysql and mysqladmin utilities to the global environment variable PATH.

2. Copy the template_db_mysql.conf file (can be downloaded from the Zabbix Git repository) into folder with Zabbix agent configuration (/etc/zabbix/zabbix_agentd.d/ by default). Don't forget restart Zabbix agent.

3. Create MySQL user for monitoring (choose your own <password>). For example:

CREATE USER 'zbx_monitor'@'%' IDENTIFIED BY '<password>';
GRANT USAGE,REPLICATION CLIENT,PROCESS,SHOW DATABASES,SHOW VIEW ON *.* TO 'zbx_monitor'@'%';

For more information, please see MYSQL documentation.

4. Create .my.cnf in the home directory of Zabbix agent for Linux (/var/lib/zabbix by default ) or my.cnf in c:\ for Windows. The file must have three strings:

[client]
user='zbx_monitor'
password='<password>'

5. Import template_db_mysql_agent.xml (template_db_mysql.xml in Zabbix versions prior to 4.4.6) into Zabbix and link it to the target host.