Ad Widget

Collapse

With item database monitor, it shows error when i try to connect to oracle with obdc

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mark.chan
    Member
    • Mar 2016
    • 35

    #1

    With item database monitor, it shows error when i try to connect to oracle with obdc

    Cannot connect to ODBC DSN:[SQL_ERROR]:[01000][0][[unixODBC][Driver Manager]Can't open lib '/usr/lib/oracle/12.1/client64/lib/libsqora.so.12.1' : file not found]|


    i can connect to the database with isql, so i am thinking is there any missing or bugs with zabbix setting?
    Code:
    [root@localhost lib]# isql -v uatt
    +---------------------------------------+
    | Connected!                            |
    |                                       |
    | sql-statement                         |
    | help [tablename]                      |
    | quit                                  |
    |                                       |
    +---------------------------------------+
    SQL>
  • Atsushi
    Senior Member
    • Aug 2013
    • 2028

    #2
    Please try to add setting of the environment variable(LD_LIBRARY_PATH).
    ex.

    Comment

    • mark.chan
      Member
      • Mar 2016
      • 35

      #3
      Thank you so much, after adding the following code, it eliminate the above error.

      Code:
      # cat /etc/sysconfig/zabbix
      LD_LIBRARY_PATH=/usr/lib/oracle/10.2.0.3/client/lib
      export LD_LIBRARY_PATH
      
      # Source sysconfig.
      . /etc/sysconfig/zabbix
      
      # systemctl restart zabbix-server
      BUT, another error come's out

      Code:
      Cannot connect to ODBC DSN:[SQL_ERROR]:[08004][12154][[unixODBC][Oracle][ODBC][Ora]ORA-12154: TNS:could not resolve the connect identifier specified
      ]|
      Last edited by mark.chan; 07-04-2016, 12:25.

      Comment

      • roberts.andzans
        Junior Member
        • Feb 2016
        • 20

        #4
        Hi,

        Have you installed mysql-connector-odbc?

        You can check more details for ODBC monitoring at - https://www.zabbix.com/documentation...es/odbc_checks


        Rob

        Comment

        • mark.chan
          Member
          • Mar 2016
          • 35

          #5
          sure, i can connect with isql

          FINALLY, I got it by DISABLE the SELinux!
          Last edited by mark.chan; 08-04-2016, 12:14.

          Comment

          • GPegel
            Senior Member
            Zabbix Certified SpecialistZabbix Certified Professional
            • Dec 2015
            • 113

            #6
            Since a couple of days I'm also trying to connect to a database via ODBC. And in my case ISQL does work but when I try to connect to the same database via Zabbix I receive this error:
            Code:
            item "ODBC Checks:db.odbc.select[egelo_test39,test]" became not supported: Cannot connect to ODBC DSN:[SQL_ERROR]:[HY000][12162][[unixODBC][Oracle][ODBC][Ora]ORA-12162: TNS:net service name is incorrectly specified
            When I do a Google search I see posts saying that I have to set the ORACLE_SID. I already did that but stil I receive this message. Also the environment variables are set.

            SELinux is already disabled so I'm out of options. I think I'm overlooking something but I don't know what. If someone is willing to help me sort this problem out than I would be very thankfull.

            Comment

            • mark.chan
              Member
              • Mar 2016
              • 35

              #7
              I had this in my ENV

              ORACLE_HOME=/usr/lib/oracle/12.1/client64

              Comment

              • mark.chan
                Member
                • Mar 2016
                • 35

                #8
                What is the Data source name (DSN) in your odbc.ini?

                Also have you check the right for zabbix to access?

                And double check the SELinux by
                Code:
                getenforce
                , it should display: Disabled
                Last edited by mark.chan; 25-05-2016, 11:06.

                Comment

                • Linwood
                  Senior Member
                  • Dec 2013
                  • 398

                  #9
                  Assuming you're set up to run that way:

                  su - zabbix # or whatever account zabbix runs under
                  isql -v uatt

                  See what you get, it's likely a difference in account setup somewhere.

                  Comment

                  • GPegel
                    Senior Member
                    Zabbix Certified SpecialistZabbix Certified Professional
                    • Dec 2015
                    • 113

                    #10
                    I've solved it... I added the line "TWO_TASK=//servername : port/database" to the system environment instead of the Zabbix environment variables. My Zabbix Environment Variables now look like this:

                    LANG=nl_NL.UTF-8
                    PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/usr/lib/oracle/12.1/client64/lib
                    CONFFILE=/etc/zabbix/zabbix_server.conf
                    ORACLE_HOME=/usr/lib/oracle/12.1/client64
                    LD_LIBRARY_PATH=/usr/lib/oracle/12.1/client64/lib:/usr/lib64
                    ORACLE_SID=databasename
                    TWO_TASK=//server : port/databasename

                    Now my Item in Zabbix can query the database and I get a result back in 'latest data'
                    Last edited by GPegel; 25-05-2016, 16:57. Reason: the combination of : and p made a stupid smily

                    Comment

                    • mark.chan
                      Member
                      • Mar 2016
                      • 35

                      #11
                      but TWO_TASK can use for different database?
                      If you need to check serval DB, should it be work?

                      Comment

                      • GPegel
                        Senior Member
                        Zabbix Certified SpecialistZabbix Certified Professional
                        • Dec 2015
                        • 113

                        #12
                        I'm not sure, I haven't test this...yet

                        Comment

                        Working...