0

I am trying Database monitor in zabbix following the official document odbc_checks

I have installed unixODBC and unixODBC drivers(mysql and oracle)

yum -y install unixODBC unixODBC-devel
yum install mysql-connector-odbc
rpm -ivh oracle-instantclient11.2-basic-11.2.0.4.0-1.x86_64.rpm
rpm -ivh oracle-instantclient11.2-odbc-11.2.0.4.0-1.x86_64.rpm
rpm -ivh oracle-instantclient11.2-devel-11.2.0.4.0-1.x86_64.rpm

and ODBC connection is working successfully for both mysql and oracle.

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

To enable ODBC support, I recompile Zabbix with ODBC support

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

and finally add a database monitoring item enter image description here

however, Mysql monitoring works fine but Oracle not :

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]|

This file does exists

ldd /usr/lib/oracle/11.2/client64/lib/libsqora.so.11.1
    linux-vdso.so.1 =>  (0x00007fffeb1ff000)
    libdl.so.2 => /lib64/libdl.so.2 (0x00007f9d254f0000)
    libm.so.6 => /lib64/libm.so.6 (0x00007f9d2526b000)
    libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f9d2504e000)
    libnsl.so.1 => /lib64/libnsl.so.1 (0x00007f9d24e35000)
    libclntsh.so.11.1 => /usr/lib/oracle/11.2/client64/lib/libclntsh.so.11.1 (0x00007f9d224c5000)
    libodbcinst.so.1 => /usr/lib64/libodbcinst.so.1 (0x00007f9d222b4000)
    libc.so.6 => /lib64/libc.so.6 (0x00007f9d21f21000)
    /lib64/ld-linux-x86-64.so.2 (0x0000003c67000000)
    libnnz11.so => /usr/lib/oracle/11.2/client64/lib/libnnz11.so (0x00007f9d21b53000)
    libaio.so.1 => /lib64/libaio.so.1 (0x00007f9d21952000)
    libltdl.so.7 => /usr/lib64/libltdl.so.7 (0x00007f9d21749000)
Chaoping Xie
  • 13
  • 1
  • 6
  • In the output of `configure`, were there any errors or warnings? At the end of the `configure` output, was ODBC support listed? Are you sure you are starting the new binary, not some older version? – Richlv Aug 18 '16 at 09:47
  • @Richlv I replace zabbix_server with new compiled binary and start it . At the end of the configure output ,there is "checking for curl-config... /usr/bin/curl-config", but no words "checking whether odbc is usable ... yes" – Chaoping Xie Aug 19 '16 at 09:15
  • check the end of the `configure` output, section `Server details` - what does it say about ODBC ? – Richlv Aug 19 '16 at 14:34
  • @Richlv Server details: ODBC: yes – Chaoping Xie Aug 22 '16 at 00:30
  • @Richlv there is new problem “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]|”, but when I run su - zabbix -c "ldd /usr/lib/oracle/11.2/client64/lib/libsqora.so.11.1", it is appears ok – Chaoping Xie Aug 22 '16 at 09:11
  • In that ldd output, is any of the referenced libs not found ? – Richlv Aug 22 '16 at 12:04
  • @Richlv no libs not found – Chaoping Xie Aug 23 '16 at 03:37
  • Well, that's a bit weird then. But it is also a different problem from the original question - I would even suggest opening a new question and providing all that detail there. – Richlv Aug 23 '16 at 13:50

0 Answers0