当前位置:网站首页>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-devel
Use zypper The package manager is based on SUSE On the system unixODBC :
zypper in unixODBC-devel
Two 、 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-odbc
Use zypper The package manager is based on SUSE On the system MySQL Database driver :
zypper in MyODBC-unixODBC
3、 ... 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 SQLConnect
Check /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
边栏推荐
- Thoughts and suggestions on the construction of intelligent management and control system platform for safe production in petrochemical enterprises
- Just a coincidence? The mysterious technology of apple ios16 is actually the same as that of Chinese enterprises five years ago!
- Understanding the architecture type of mobile CPU
- Learn memory management of JVM 01 - first memory
- Get all stock data of big a
- 手机 CPU 架构类型了解
- 报错ModuleNotFoundError: No module named ‘cv2.aruco‘
- HiEngine:可媲美本地的云原生内存数据库引擎
- POJ-2499 Binary Tree
- 多表操作-自关联查询
猜你喜欢
Get all stock data of big a
Multi table operation - Auto Association query
1 plug-in to handle advertisements in web pages
Embedded software architecture design - message interaction
MySQL splits strings for conditional queries
Riddle 1
Understand kotlin from the perspective of an architect
Tabbar configuration at the bottom of wechat applet
Simple production of wechat applet cloud development authorization login
Uniapp + unicloud + Unipay realize wechat applet payment function
随机推荐
Why do you always fail in automated tests?
The solution of outputting 64 bits from printf format%lld of cross platform (32bit and 64bit)
查看rancher中debug端口信息,并做IDEA Remote Jvm Debug
互联网公司实习岗位选择与简易版职业发展规划
【load dataset】
Embedded software architecture design - message interaction
Open3d European clustering
Learn the memory management of JVM 02 - memory allocation of JVM
多表操作-子查询
Take you two minutes to quickly master the route and navigation of flutter
[pytorch pre training model modification, addition and deletion of specific layers]
Recyclerview paging slide
mmclassification 训练自定义数据
Four operations and derivative operations of MATLAB polynomials
Learn the memory management of JVM 03 - Method area and meta space of JVM
ABAP table lookup program
Simply solve the problem that the node in the redis cluster cannot read data (error) moved
SENT协议译码的深入探讨
Deep discussion on the decoding of sent protocol
Reading notes of growth hacker