当前位置:网站首页>ZABBIX ODBC database monitoring
ZABBIX ODBC database monitoring
2022-07-05 12:19:00 【Xiaobo】
One 、 install unixODBC
Can be in unixODBC Get it on the home page :http : //www.unixodbc.org/download.html.
Use yum The package manager is based on RedHat/Fedora On the system unixODBC :
yum -y install unixODBC unixODBC-develUse zypper The package manager is based on SUSE On the system unixODBC :
zypper in unixODBC-develTwo 、 install unixODBC The driver
Should be installed for this database unixODBC Database driver , The driver will be monitored .unixODBC There is a list of supported databases and drivers :http : //www.unixodbc.org/drivers.html. In some Linux Distribution in , The database driver is included in the package repository .
example : Use yum The package manager is based on RedHat/Fedora On the system MySQL Database driver :
yum install mysql-connector-odbcUse zypper The package manager is based on SUSE On the system MySQL Database driver :
zypper in MyODBC-unixODBC3、 ... and 、 To configure unixODBC
1.ODBC Configuration is through editing odbcinst.ini and odbc.ini Documents to complete . To verify the location of the configuration file , Please enter :
[[email protected] lib64]# odbcinst -j
unixODBC 2.3.7
DRIVERS............: /etc/odbcinst.ini
SYSTEM DATA SOURCES: /etc/odbc.ini
FILE DATA SOURCES..: /etc/ODBCDataSources
USER DATA SOURCES..: /root/.odbc.ini
SQLULEN Size.......: 8
SQLLEN Size........: 8
SQLSETPOSIROW Size.: 8
2. odbcinst.ini Used to list installed ODBC Database driver :
[[email protected] ~]# cat /etc/odbcinst.ini
# Example driver definitions
# Driver from the postgresql-odbc package
# Setup from the unixODBC package
[PostgreSQL]
Description = ODBC for PostgreSQL
Driver = /usr/lib/psqlodbcw.so
Setup = /usr/lib/libodbcpsqlS.so
Driver64 = /usr/lib64/psqlodbcw.so
Setup64 = /usr/lib64/libodbcpsqlS.so
FileUsage = 1
# Driver from the mysql-connector-odbc package
# Setup from the unixODBC package
[MySQL]
Description = ODBC for MySQL
Driver = /usr/lib/libmyodbc5.so
Setup = /usr/lib/libodbcmyS.so
Driver64 = /usr/lib64/libmyodbc5.so
Setup64 = /usr/lib64/libodbcmyS.so
FileUsage = 1
# Install this example mysql odbc After driving , The following driving information will be added
[MySQL ODBC 8.0 Unicode Driver]
Driver=/usr/lib64/libmyodbc8w.so
UsageCount=1
[MySQL ODBC 8.0 ANSI Driver]
Driver=/usr/lib64/libmyodbc8a.so
UsageCount=1
| Parameters | describe |
|---|---|
| mysql | Database driver name . |
| Description | Database driver description . |
| Driver | Database driver library location . |
3. odbc.ini Used to define the data source :
[test]
Description = MySQL test database
Driver = MySQL ODBC 8.0 Unicode Driver # Note that the newly installed mysql Database driven
Server = 127.0.0.1
User = root
Password = xxx
Port = 3306
Database = zabbix| attribute | describe |
|---|---|
| test | Data source name (DSN). |
| Description | Data source description . |
| Driver | Database driver name - stay odbcinst.ini It is specified in |
| Server | database server IP/DNS. |
| User | Database user for connection . |
| Password | Database user password . |
| Port | Database connection port . |
| Database | Database name . |
4. To verify ODBC Whether the connection works successfully , The connection to the database should be tested . This can be done by isql Utilities ( Included in unixODBC In bag ) To complete :
[[email protected] lib64]# isql test
+---------------------------------------+
| Connected! |
| |
| sql-statement |
| help [tablename] |
| quit |
| |
+---------------------------------------+
SQL>
Be careful : If an error is reported as follows
[[email protected] ~]# isql test
[ISQL]ERROR: Could not SQLConnectCheck /etc/odbcinst.ini Database driver in file "Driver" Whether the parameter information is related to the downloaded database driver .so File path is consistent . This example passes yum download , So pass rpm -ql Command query

In this example, it is normal after modifying this path , perhaps Try to replace the new version of database driver
边栏推荐
- The solution of outputting 64 bits from printf format%lld of cross platform (32bit and 64bit)
- MySQL trigger
- Xi IO flow
- Master the new features of fluent 2.10
- HiEngine:可媲美本地的云原生内存数据库引擎
- JS for loop number exception
- MySQL index (1)
- MySQL data table operation DDL & data type
- How does MySQL execute an SQL statement?
- [untitled]
猜你喜欢

Wireless WiFi learning 8-channel transmitting remote control module

Principle of persistence mechanism of redis

One article tells the latest and complete learning materials of flutter

Redirection of redis cluster
调查显示传统数据安全工具在60%情况下无法抵御勒索软件攻击
你做自动化测试为什么总是失败?

Understand redis persistence mechanism in one article

MySQL storage engine
![[untitled]](/img/56/6a9a4bcab6503872942fff7a365def.jpg)
[untitled]

Uniapp + unicloud + Unipay realize wechat applet payment function
随机推荐
Thoughts and suggestions on the construction of intelligent management and control system platform for safe production in petrochemical enterprises
[pytorch modifies the pre training model: there is little difference between the measured loading pre training model and the random initialization of the model]
Multi table operation - Auto Association query
MySQL splits strings for conditional queries
Time tools
【ijkplayer】when i compile file “compile-ffmpeg.sh“ ,it show error “No such file or directory“.
POJ-2499 Binary Tree
Solution to order timeout unpaid
Read and understand the rendering mechanism and principle of flutter's three trees
报错ModuleNotFoundError: No module named ‘cv2.aruco‘
Matlab superpixels function (2D super pixel over segmentation of image)
Learn the garbage collector of JVM -- a brief introduction to Shenandoah collector
MySQL transaction
你做自动化测试为什么总是失败?
Differences between IPv6 and IPv4 three departments including the office of network information technology promote IPv6 scale deployment
7月华清学习-1
自动化测试生命周期
MySQL regular expression
II. Data type
Instance + source code = see through 128 traps