Ad Widget

Collapse

Oracle Database monitoring with unixODBC

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • traq911
    Junior Member
    • May 2005
    • 17

    #1

    Oracle Database monitoring with unixODBC

    I'm experimenting with Zabbix 1.5.3 and the new database monitoring module. After going through the pains of getting unixODBC functional (mainly becuase my distro's binary package was broken so I had to go get the sources and compile it myself), I'm unable to fully use it due to some flaws that may arguably be with unixODBC or perhaps the Oracle ODBC driver.

    In order to run isql and establish an ODBC connection to Oracle I need to have three environment variables set. ORACLE_SID, TWO_TASK, and TNS_ADMIN.

    TNS_ADMIN does not change and simply points to my tnsnames.ora file for database host and port mapping. I can easily set this before starting zabbix. ORACLE_SID and TWO_TASK need to have the database name I'm connecting to in addition to the isql command, therefore, I'm assuming they would be needed for any library based ODBC call as well.

    The problem is that requiring these variables stops me from checking multiple databases. If I set them before launching zabbix I can check that database. I can't check any other Oracle databases though. The connections fail even though I have them defined in the ODBC configs.

    If you could set these variables before making the ODBC call then I assume that would fix the problem.
  • akbar415
    Senior Member
    • May 2015
    • 119

    #2
    I have the same problem.
    Do you figure out how to solve it?

    Comment

    • traq911
      Junior Member
      • May 2005
      • 17

      #3
      I have it working just fine now, but it's been so long that I don't remember the details on how. It may have been a Zabbix or unixODBC upgrade, or perhaps an odbc.ini correction.

      An entry in odbc.ini should look like this:

      Code:
      [ORCL]
      Driver = Oracle_12c
      ServerName = //server:1521/orcl
      ..and in odbcinst.ini

      Code:
      [Oracle_12c]
      Description     = Oracle ODBC driver for Oracle 12c
      Driver          = /usr/lib/oracle/12.1/client64/lib/libsqora.so.12.1
      Setup           =
      FileUsage       =
      CPTimeout       =
      CPReuse         =
      I'm using the oracle 12c instant client for linux.

      This probably isn't too helpful, so sorry about that. It does work with multiple Oracle databases though. Hopefully this helps you find the motivation to keep troubleshooting.

      Comment

      • akbar415
        Senior Member
        • May 2015
        • 119

        #4
        Originally posted by traq911
        I have it working just fine now, but it's been so long that I don't remember the details on how. It may have been a Zabbix or unixODBC upgrade, or perhaps an odbc.ini correction.

        An entry in odbc.ini should look like this:

        Code:
        [ORCL]
        Driver = Oracle_12c
        ServerName = //server:1521/orcl
        ..and in odbcinst.ini

        Code:
        [Oracle_12c]
        Description     = Oracle ODBC driver for Oracle 12c
        Driver          = /usr/lib/oracle/12.1/client64/lib/libsqora.so.12.1
        Setup           =
        FileUsage       =
        CPTimeout       =
        CPReuse         =
        I'm using the oracle 12c instant client for linux.

        This probably isn't too helpful, so sorry about that. It does work with multiple Oracle databases though. Hopefully this helps you find the motivation to keep troubleshooting.
        Firstly, thanks for you answer. I already make it work (after 3 days of hard work).
        It's just like you posted.

        But I have to upgrade the unixODBC to newest version. Tomorrow I wil try with multiple databases, I'm very trusyful once I don't need any environment variable to accomplish this.

        Once again. Thanks for your help and sorry for my bad, bad english ( a bit of google translate here )

        Comment

        Working...