Zabbix Learning notes 4-ODBC database monitoring

Source: Internet
Author: User
Tags odbc

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.