[ZBX-24686] Cannot connect to ODBC DSN: [SQL_ERROR]:[01000][0][[unixODBC][Driver Manager]Can't open lib '/usr/lib/oracle/11.2/client64/lib/libsqora.so.11.1' : file not found] Created: 2024 Jun 20  Updated: 2024 Jul 04  Resolved: 2024 Jun 26

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Server (S)
Affects Version/s: 6.0.30
Fix Version/s: None

Type: Problem report Priority: Trivial
Reporter: mingking Assignee: dimir
Resolution: Won't fix Votes: 0
Labels: odbc_Monitor
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File image-2024-06-20-10-06-15-506.png     PNG File image-2024-06-20-10-34-50-602.png     PNG File image-2024-06-20-10-35-21-898.png    

 Description   

  1. web error on this picture:

2.with odbc Monitor Configuration Below:

[root@Ora ~]# rpm -qa |grep ODBC
unixODBC-devel-2.3.7-3.oe2203sp2.x86_64
unixODBC-2.3.7-3.oe2203sp2.x86_64

 

[root@Ora ~]# 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
[root@Ora ~]#
[root@Ora ~]# cat /etc/odbc.ini
[audit]
Driver = Oracle
ServerName = xxxxxxxxxx:1521/audit
UserID = xxx
Password = xxxx

 

[root@Ora ~]# cat /etc/odbcinst.ini

[Oracle]
Driver=/usr/lib/oracle/11.2/client64/lib/libsqora.so.11.1

 

[root@Ora ~]# isql -v audit
---------------------------------------

Connected!                            
                                     
sql-statement                        
help [tablename]                      
quit                                  
                                     

---------------------------------------
SQL> select status from gv$instance;
-------------

STATUS      

-------------

OPEN        
OPEN        

-------------
SQLRowCount returns -1
2 rows fetched
SQL>

 

3. user zabbix and root ldd output Below : 

[root@Ora zabbix]# chmod 777 -R /usr/lib/oracle

[root@Ora zabbix]# ls -l /usr/lib/oracle/11.2/client64/lib/libsqora.so.11.1
-rwxrwxrwx 1 root root 1003582 Aug 25  2013 /usr/lib/oracle/11.2/client64/lib/libsqora.so.11.1

[root@Ora ~]# ldd /usr/lib/oracle/11.2/client64/lib/libsqora.so.11.1
        linux-vdso.so.1 (0x00007ffd787d3000)
        libdl.so.2 => /usr/lib64/libdl.so.2 (0x00007f55efee9000)
        libm.so.6 => /usr/lib64/libm.so.6 (0x00007f55efe0e000)
        libpthread.so.0 => /usr/lib64/libpthread.so.0 (0x00007f55efe0b000)
        libnsl.so.1 => /usr/lib64/libnsl.so.1 (0x00007f55efdf1000)
        libclntsh.so.11.1 => /usr/lib/oracle/11.2/client64/lib/libclntsh.so.11.1 (0x00007f55ed482000)
        libodbcinst.so.1 => /usr/lib64/libodbcinst.so.1 (0x00007f55ed468000)
        libc.so.6 => /usr/lib64/libc.so.6 (0x00007f55ed267000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f55f00b0000)
        libnnz11.so => /usr/lib/oracle/11.2/client64/lib/libnnz11.so (0x00007f55ece9a000)
        libaio.so.1 => /usr/lib64/libaio.so.1 (0x00007f55ece95000)
        libltdl.so.7 => /usr/lib64/libltdl.so.7 (0x00007f55ece89000)

[root@Ora zabbix]# env
SHELL=/bin/bash
HISTCONTROL=ignoredups
HISTSIZE=5
HOSTNAME=Ora
JAVA_HOME=/usr/local/jdk1.8.0_141
PWD=/usr/local/zabbix
LOGNAME=root
MOTD_SHOWN=pam
HOME=/root
LANG=en_US.UTF-8
ORACLE_HOME=/usr/lib/oracle/11.2/client64
TERM=xterm
USER=root
NLS_LANG=simplified chinese_china.ZHS16GBK
SHLVL=1
CLASSPATH=.:/usr/local/jdk1.8.0_141/jre/lib/rt.jar:/usr/local/jdk1.8.0_141/lib/dt.jar:/usr/local/jdk1.8.0_141/lib/tools.jar
LD_LIBRARY_PATH=/usr/lib64:/usr/lib/oracle/11.2/client64/lib
TNS_ADMIN=/usr/lib/oracle/11.2/client64/network/admin
PATH=/usr/lib/oracle/11.2/client64/bin:/usr/local/jdk1.8.0_141/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/usr/lib/oracle/11.2/client64/lib
MAIL=/var/spool/mail/root
SSH_TTY=/dev/pts/0
OLDPWD=/usr/local
_=/usr/bin/env

4. zabbix_server path with Binary compilation:

[root@Ora zabbix]# pwd
/usr/local/zabbix
[root@Ora zabbix]#

[root@Ora zabbix]# ls
alertscripts  bin  etc  externalscripts  html  lib  log  sbin  share

5.Find a closer solution on the official website,But there is no process environment variable associated with Oracle

[root@Ora zabbix]# cat /etc/sysconfig/zabbix-server
ORACLE_HOME=/usr/lib/oracle/11.2/client64
LD_LIBRARY_PATH=/usr/lib/oracle/11.2/client64/lib:/usr/lib64
TNS_ADMIN=/usr/lib/oracle/11.2/client64/network/admin
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/usr/lib/oracle/11.2/client64/lib

export ORACLE_HOME
export LD_LIBRARY_PATH
export TNS_ADMIN
export PATH

[root@Ora zabbix]# systemctl restart zabbix_server

[root@Ora zabbix]# ps -ef |grep zabbix
zabbix   1376564       1  0 May30 ?        00:00:00 /usr/local/zabbix/sbin/zabbix_agentd

[root@Ora diag]# strings -a /proc/1376564/environ
LANG=en_US.UTF-8
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
INVOCATION_ID=24630e794f684037bc7f4d2af81c340d
JOURNAL_STREAM=8:297078272
SYSTEMD_EXEC_PID=2437294

How to make the main process with oracle environment variables ?Or deal with the problem of not finding the file ”libsqora.so.11.1“

 



 Comments   
Comment by dimir [ 2024 Jun 26 ]

This is not a Zabbix issue. Your system (ldconfig) is not properly configured. You need to add the path to the list of paths:

echo "/usr/lib/oracle/11.2/client64/lib" | sudo tee /etc/ld.so.conf.d/oracle-client-12.2.conf
sudo ldconfig -v | grep oracle

Closing "Won't fix", feel free to re-open if you disagree.

Comment by mingking [ 2024 Jun 27 ]

Before referring to the configuration steps of many people I have done this step,The error remains:

in user root setup:
echo "/usr/lib/oracle/11.2/client64/lib" >/etc/ld.so.conf.d/oracle-instantclient.conf
ldconfig -v

Check the code:
echo "/usr/lib/oracle/11.2/client64/lib" | sudo tee /etc/ld.so.conf.d/oracle-client-12.2.conf

Must the file name be identical to the code provided, But I think it's just a filename, whether it's 12 or 21, it's mostly the contents of the file.

It's okay, just consulting. It may also be the use of the operating system-level problems, later also replaced the oracle high version of the driver, for the time being you can use ODBC to monitor

Comment by dimir [ 2024 Jul 04 ]

Yeah, all those numbers are just an example, you should use exactly what you have. The following commands could help you generate the proper command:

find /usr/lib/oracle -name '*.so'
find /etc -name 'oracle-client*.conf' 
Generated at Thu May 01 06:49:47 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.