Ad Widget

Collapse

Cant connect to ODBC DSN: Data source name not found and no default driver specified

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • clauclauds
    Junior Member
    • Sep 2020
    • 13

    #1

    Cant connect to ODBC DSN: Data source name not found and no default driver specified

    I install ODBC to monitoring Oracle Database via Zabbix, but I got error :

    Cannot connect to ODBC DSN: [SQL_ERROR]:[IM002][0][[unixODBC][Driver Manager]Data source name not found, and no default driver specified]
    I did everything on tutorial, here's my config :

    /etc/odbcinst.ini :
    Code:
    [OracleDriver]
    Description=Oracle ODBC driver for Oracle 11g
    Driver=/usr/lib/oracle/11.2/client64/lib/libsqora.so.11.1
    /etc/odbc.ini :
    Code:
    [TESTDB]
    Driver= OracleDriver
    DSN= TESTDB
    ServerName= TESTDB
    UserID= zabbix
    Password= zabbix
    tnsnames.ora :
    Code:
    TESTDB =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = XXX.XXX.XXX)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = EXAMPLE)
    )
    )
    However when i try to connect isql with
    Code:
     isql -v TESTDB
    it works and connect to isql

    I try to follow this step too https://stackoverflow.com/questions/...db-with-zabbix, from that step I should make /etc/default/zabbix-server that contain oracle home, ld library path, nls lang, and tns admin but because i'm using zabbix proxy so i make /etc/default/zabbix-proxy instead. then I have to restart zabbix-proxy and do this command strings -a /proc/(pid number)/environ, but it doesn't solve my problem..

    can somebody help me?
  • Hamardaban
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • May 2019
    • 2713

    #2
    You did not specify how the item you are using is configured. As well as the zabbix version.
    Check all settings as written in the documentation https://www.zabbix.com/documentation...es/odbc_checks

    Comment


    • clauclauds
      clauclauds commented
      Editing a comment
      but I'm using template for monitoring by ODBC
  • Hamardaban
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • May 2019
    • 2713

    #3
    Using templates does not make it impossible to change them. there are different templates. templates change.
    Fantasizing about what template you use - will not help.

    Comment


    • andreiy
      andreiy commented
      Editing a comment
      Good thing you're the smart one.
      Why not help the guy, instead of asking open ended questions and then following up with unhelpful commentaries?

      You should probably quit this forum while you're ahead.
  • baramann
    Junior Member
    • Jan 2021
    • 9

    #4
    - Did you set {$ORACLE.DSN} in the host macro with TESTDB?
    - What is the output of "odbcinst -j"

    Comment


    • clauclauds
      clauclauds commented
      Editing a comment
      yes i set it as TESTDB,
      here's output of odbcinst -j :
      unixODBC 2.3.1
      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
  • sajid4uu2c
    Junior Member
    • Oct 2020
    • 24

    #5
    Hi ,

    I am also facing issues for setting oracle DB monitoring.

    I am not able to find tnsnames.ora file. Can we create it manually ?

    Comment

    • Vinicius Souza
      Junior Member
      • Jan 2022
      • 8

      #6
      I am also facing problem at this point.
      my settings are like this

      Click image for larger version

Name:	image.png
Views:	10857
Size:	16.2 KB
ID:	451116

      directories ORACLE INSTANT CLIENTE
      /opt/oracle/instantclient_21_7/

      As zabbix did not find the dns I put the files odbc.ini and odbcinst.ini in several directories that I will list below this text.
      /etc
      ​/etc/ODBCDataSources

      /root
      .odbc.ini - PERMISSION : 755
      ​[OracleODBC-21]
      AggregateSQLType = FLOAT
      Application Attributes = T
      Attributes = W
      BatchAutocommitMode = IfAllSuccessful
      BindAsFLOAT = F
      CacheBufferSize = 20
      CloseCursor = F
      DisableDPM = F
      DisableMTS = T
      DisableRULEHint = T
      Driver = Oracle 21 ODBC driver
      DSN = OracleODBC-21
      EXECSchemaOpt =
      EXECSyntax = T
      Failover = T
      FailoverDelay = 10
      FailoverRetryCount = 10
      FetchBufferSize = 64000
      ForceWCHAR = F
      LobPrefetchSize = 8192
      Lobs = T
      Longs = T
      MaxLargeData = 0
      MaxTokenSize = 8192
      MetadataIdDefault = F
      QueryTimeout = T
      ResultSets = T
      ServerName =
      SQLGetData extensions = F
      SQLTranslateErrors = F
      StatementCache = F
      Translation DLL =
      Translation Option = 0
      UseOCIDescribeAny = F
      ServerName = PROD
      UserID = XXXXXXXX
      Password = XXXXXX

      .odbcinst.ini - PERMISSION : 755
      [Oracle 21c ODBC driver]
      Description = Oracle ODBC driver for Oracle 21c
      Driver = /opt/oracle/instantclient_21_7/libsqora.so.21.1
      Setup =
      FileUsage =
      CPTimeout =
      CPReuse =




      Comment

      • Blevar
        Member
        • Jan 2025
        • 68

        #7
        Have you tried providing correct path to the driver etc. In the Hosts inherited macros?

        Comment

        Working...