当前位置:网站首页>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
边栏推荐
- struct MySQL
- Take you hand in hand to develop a service monitoring component
- 查看rancher中debug端口信息,并做IDEA Remote Jvm Debug
- JS for循环 循环次数异常
- Sentinel sentinel mechanism of master automatic election in redis master-slave
- Master the new features of fluent 2.10
- Learn JVM garbage collection 05 - root node enumeration, security points, and security zones (hotspot)
- MySQL index (1)
- Learning JVM garbage collection 06 - memory set and card table (hotspot)
- Learn the memory management of JVM 02 - memory allocation of JVM
猜你喜欢
A guide to threaded and asynchronous UI development in the "quick start fluent Development Series tutorials"
Matlab label2idx function (convert the label matrix into a cell array with linear index)
Understand kotlin from the perspective of an architect
Four operations and derivative operations of MATLAB polynomials
Reading notes of growth hacker
Redis's memory elimination mechanism, read this article is enough.
Two minutes will take you to quickly master the project structure, resources, dependencies and localization of flutter
Error modulenotfounderror: no module named 'cv2 aruco‘
Network five whip
One article tells the latest and complete learning materials of flutter
随机推荐
Wireless WiFi learning 8-channel transmitting remote control module
Learn garbage collection 01 of JVM -- garbage collection for the first time and life and death judgment
Principle and performance analysis of lepton lossless compression
Third party payment interface design
Reinforcement learning - learning notes 3 | strategic learning
JS for loop number exception
MySQL function
Interviewer: is acid fully guaranteed for redis transactions?
Differences between IPv6 and IPv4 three departments including the office of network information technology promote IPv6 scale deployment
Why do you always fail in automated tests?
Automated test lifecycle
abap查表程序
One article tells the latest and complete learning materials of flutter
ABAP table lookup program
Learn memory management of JVM 01 - first memory
Acid transaction theory
Take you hand in hand to develop a service monitoring component
图像超分实验:SRCNN/FSRCNN
Thoughts and suggestions on the construction of intelligent management and control system platform for safe production in petrochemical enterprises
Four operations and derivative operations of MATLAB polynomials