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.
1. Install Zabbix agent and MySQL client.
If necessary, add the path to the
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.
.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>'
template_db_mysql.xml in Zabbix versions prior to 4.4.6) into Zabbix and link it to the target host.