Ad Widget

Collapse

ODBC monitoring error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Cenzoooo
    Member
    • Jul 2015
    • 37

    #1

    ODBC monitoring error

    Hello,

    I can't set up ODBC monitoring for some reason and I am not sure why... In frontend I am getting 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 by the book:

    root@zbx_database:~# more /etc/odbc.ini
    [test]
    Description = MySQL test database
    Driver = mysql
    DSN = test
    Server = 172.16.10.144
    User = zabbix
    Password =
    Port = 3306
    Database = zabbix
    ------------------------
    root@zbx_database:~# more /etc/odbcinst.ini
    [mysql]
    Description = ODBC for MySQL
    Driver = /home/zabbix/mysql-connector-odbc-8.0.13-linux-ubuntu18.04-x86-64bit/lib/libmyodbc8w.so
    Setup = /home/zabbix/mysql-connector-odbc-8.0.13-linux-ubuntu18.04-x86-64bit/lib/libmyodbc8w.so
    FileUsage = 1

    ---------------------------------
    root@zbx_database:/home/zabbix/mysql-connector-odbc-8.0.13-linux-ubuntu18.04-x86-64bit/lib# ls -l
    total 13168
    -rw-r--r-- 1 7161 31415 6013680 Sep 26 17:38 libmyodbc8S.so
    -rw-r--r-- 1 7161 31415 7464712 Sep 26 17:38 libmyodbc8w.so

    -------------------------------
    root@zbx_database:~# isql -v test zabbix
    +---------------------------------------+
    | Connected! |
    | |
    | sql-statement |
    | help [tablename] |
    | quit |
    | |
    +---------------------------------------+
    SQL>


    Configuration of an item is in attachement. What am I doing wrong?
    Attached Files
    Last edited by Cenzoooo; 29-11-2018, 14:36.
  • ArtursL
    Senior Member
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Nov 2018
    • 167

    #2
    Hi,
    Have you tried troubleshooting ODBC via isql, for example?
    You should be able to connect with the following command:
    isql "DSN" "USER" PASSWORD"

    Comment

    • Semiadmin
      Senior Member
      • Oct 2014
      • 1625

      #3
      I'm not sure that's your only problem but ODBC LLD key must be db.odbc.discovery[something,test], not db.odbc.discovery[,test]

      Comment

      • clauclauds
        Junior Member
        • Sep 2020
        • 13

        #4
        hey is this solve the problem? because i have same issues

        Comment

        • Singularity
          Member
          • Aug 2020
          • 81

          #5
          Can you post your item key here. I had the same problem, found out the issue was with the item key parameter. I was passing incorrect macro value in my key.

          Comment

          • pauliusbau
            Junior Member
            • Mar 2022
            • 1

            #6
            Hi.
            Had same issue. In my case SElinux was blocking access to odbc.ini:
            Click image for larger version

Name:	Screenshot 2022-03-30 160728.png
Views:	1282
Size:	98.3 KB
ID:	442340

            Fixed it by executing these commands:
            Code:
            tail /var/log/audit/audit.log | audit2allow -M mypol
            semodule -i mypol.pp

            Comment

            Working...