创建“数据库监视器"时无法打开 lib '/usr/lib/oracle/11.2/client64/

时间:2023-04-04
本文介绍了创建“数据库监视器"时无法打开 lib '/usr/lib/oracle/11.2/client64/lib/libsqora.so.11.1zabbix 中的项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

在此之前,安装了 unixODBC

Before that, unixODBC was installed

  1. unixODBC.x86_64 2.2.14-14.el6
  2. unixODBC-devel.x86_64 2.2.14-14.el6

安装的Oracle ODBC驱动是:

And Oracle ODBC driver installed is:

  1. oracle-instantclient11.2-basic-11.2.0.1.0-1.x86_64
  2. oracle-instantclient11.2-odbc-11.2.0.1.0-1.x86_64
  3. oracle-instantclient11.2-devel-11.2.0.1.0-1.x86_64

和 odbcinst.ini:

And odbcinst.ini:

[Oracle-11g]
Description=ODBC for Oracle
Driver=/usr/lib/oracle/11.2/client64/lib/libsqora.so.11.1
UsageCount=1
FileUsage=1
Driver Logging = 7

odbc.ini:

[test]
Driver      = Oracle-11g
DSN = Oracle-11g
ServerName =  gzdb
UserID = xxx
Password = xxx

并且 ODBC 连接成功

And ODBC connection is working successfully

shell> isql -v test
+---------------------------------------+
| Connected!                            |
|                                       |
| sql-statement                         |
| help [tablename]                      |
| quit                                  |
|                                       |
+---------------------------------------+

为了启用 ODBC 支持,我重新编译了 zabbix3.0 标志:--with-unixodbc

To enable ODBC support, I recompiled zabbix3.0 with flag: --with-unixodbc

./configure --enable-server --enable-agent --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl --with-libxml2 --with-unixodbc

并用新编译的二进制文件替换旧的 zabbix_sever.

and replace the old zabbix_sever with new binary compiled.

但是,当我在zabbix中创建Database Monitor"项时,仍然出现错误:在此处输入图片描述

However, When I create "Database Monitor" item in zabbix,there is still an error: enter image description here

所以我运行 su - zabbix -c "ldd/usr/lib/oracle/11.2/client64/lib/libsqora.so.11.1"看起来没问题

So I run su - zabbix -c "ldd /usr/lib/oracle/11.2/client64/lib/libsqora.so.11.1" it appears ok

 su - zabbix -c "ldd /usr/lib/oracle/11.2/client64/lib/libsqora.so.11.1"
    linux-vdso.so.1 =>  (0x00007fffe21ee000)
    libdl.so.2 => /lib64/libdl.so.2 (0x00007f1ad095e000)
    libm.so.6 => /lib64/libm.so.6 (0x00007f1ad06d9000)
    libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f1ad04bc000)
    libnsl.so.1 => /lib64/libnsl.so.1 (0x00007f1ad02a3000)
    libclntsh.so.11.1 => /usr/lib/oracle/11.2/client64/lib/libclntsh.so.11.1 (0x00007f1acdd72000)
    libodbcinst.so.1 => /usr/lib64/libodbcinst.so.1 (0x00007f1acdb61000)
    libc.so.6 => /lib64/libc.so.6 (0x00007f1acd7cd000)
    /lib64/ld-linux-x86-64.so.2 (0x000000373c600000)
    libnnz11.so => /usr/lib/oracle/11.2/client64/lib/libnnz11.so (0x00007f1acd404000)
    libaio.so.1 => /lib64/libaio.so.1 (0x00007f1acd203000)
    libltdl.so.7 => /usr/lib64/libltdl.so.7 (0x00007f1accffa000)

我真的不知道错误是什么意思

I really do not know what the error means

推荐答案

那是因为你的 zabbix 服务器不知道去哪里寻找 Oracle 库.尝试将环境变量LD_LIBRARY_PATH导出到zabbix服务器

That because your zabbix server doesn't know where to look for the Oracle lib. Try to export environment variable LD_LIBRARY_PATH to the zabbix server

不知道你用的是什么操作系统,我用的是 CentOS 7

Don't know what OS you are using, I'm on CentOS 7

创建/etc/sysconfig/zabbix-server 文件,并使用

create /etc/sysconfig/zabbix-server file, and edit with

LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/lib/oracle/12.1/client64/lib"
export LD_LIBRARY_PATH

然后重启zabbix-server

then restart zabbix-server

这篇关于创建“数据库监视器"时无法打开 lib '/usr/lib/oracle/11.2/client64/lib/libsqora.so.11.1zabbix 中的项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

上一篇:Yii:获取每月热门用户和年末热门用户的SQL查询 下一篇:如何使用 Zabbix 监控数据库文件大小

相关文章