ODBC is a middleware interface developed by the C language to access the database, Zabbix supports querying any ODBC-supported database, Zabbix by invoking ODBC to obtain database data and database state, etc.
Installing UNIXODBC
Yum Install UnixODBC unixodbc-devel-y
Installing the UNIXODBC Drive
To monitor databases such as MySQL, you must first install the UNIXODBC database driver based on C development Redhat Direct Yum Installation
Yum Install Mysql-connector-odbc
Configure UNIXODBC
Configure Odbcinst.ini and Odbc.ini two configuration files to verify that the configuration is working
Odbcinst-j
Cat/etc/odbcinst.ini
[MySQL]
Description= ODBC for MySQL
Driver=/usr/lib64/libmyodbc5.so
Cat/etc/odbc.ini
[Test]
Description=mysql Test Database
Driver=mysql
server=127.0.0.1
User=root
password=
port=3306
Database=zabbix
Verifying that ODBC is available
Isql-v Test
Compiling ODBC-enabled Zabbix
--with-unixodbc
Here I'm monitoring the Zabbix server's local MySQL
Adding monitoring items
Type: Database monitoring
Key value: Db.odbc.select[a,test] A is a unique description, test is the name defined in the ODBC file
SQL query: Select userid from Users where name= ' Zabbix '
This article from "Eight Miles" blog, declined reprint!
Zabbix Learning notes 4-ODBC database monitoring