Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-17437

Cannot connect to ODBC DSN: [SQL_ERROR]:[08004][12154][[unixODBC][Oracle][ODBC][Ora]ORA-12154: TNS:could not resolve the connect identifier specified

XMLWordPrintable

    • Icon: Incident report Incident report
    • Resolution: Won't fix
    • Icon: Trivial Trivial
    • None
    • 4.0.17
    • Server (S)
    • None
    • Centos 7.5
      Oracle Client 11g
      unixodbc 2.3.1

      i already installed unixodbc, oracleclient successfully.

      i can use isql and oracle client to query database.(both root & zabbix user)

      then i go to zabbix web to fix an item for oracledb.

      and item throwed a problem like this:

       

      i searched some result for this problem , and i solved it , use:
      **

      echo "/usr/lib/oracle/11.2/client64/lib" > /etc/ld.so.conf.d/oracle-client-11.2.conf
      sudo ldconfig
      # check if path is listed
      sudo ldconfig -v
      

      but after, item came out this problem:

      Cannot connect to ODBC DSN: [SQL_ERROR]:[08004][12154][[unixODBC][Oracle][ODBC][Ora]ORA-12154: TNS:could not resolve the connect identifier specified
      

       

      my zabbix installed by src source(make & makeinstall)

      this is my installed url :

      /opt/zabbix/zabbix
      
      [root@localhost zabbix]# ls
      bin  etc  lib  sbin  scripts  share
      [root@localhost zabbix]# 
      

      because i did't find the file: /etc/sysconfig/zabbix-server

      *so i created this file and writed this in file:*

      -rwxr-xr-x    1 root root   146 3月  11 11:43 zabbix-server
      drwxr-xr-x.   6 root root  4096 3月  11 11:43 .
      [root@localhost sysconfig]# more zabbix-server
      ORACLE_HOME=/usr/lib/oracle/11.2/client64
      LD_LIBRARY_PATH=/usr/lib/oracle/11.2/client64/lib
      TNS_ADMIN=/usr/lib/oracle/11.2/client64/network/admin
      [root@localhost sysconfig]# 
      

      *but it still did't work, and i writed this into this file:*

      cd /etc/rc.d/init.d/
      vi zabbix_server
      
      # Source function library.
      . /etc/init.d/functions# Variables
      # Edit these to match your system settings        # Zabbix-Directory
              BASEDIR=/opt/zabbix/zabbix        # Binary File
              BINARY_NAME=zabbix_server        # Full Binary File Call
              FULLPATH=$BASEDIR/sbin/$BINARY_NAME        # PID file
              PIDFILE=/tmp/$BINARY_NAME.pid        # Establish args
              ERROR=0
              STOPPING=0
      
      #### here i writed ####
      ORACLE_HOME=/usr/lib/oracle/11.2/client64
      LD_LIBRARY_PATH=/usr/lib/oracle/11.2/client64/lib
      TNS_ADMIN=/usr/lib/oracle/11.2/client64/network/admin
      PATH=$PATH:$ORACLE_HOME/bin:$HOME/bin
      
      ...
      
      wq!

      and i use this to see zabbix pid, it still can't find oracle env:

       

      so , can u tell me how to add oracle env for zabbix?  thank u!!!!

       

       

            zabbix.support Zabbix Support Team
            lijian37 lijian
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: