Ad Widget

Collapse

Zabbix and MySQL ODBC returning weird values, like "en_US.UTF-8".

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • zaicnupagadi
    Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2010
    • 73

    #1

    Zabbix and MySQL ODBC returning weird values, like "en_US.UTF-8".

    -THIS HAS BEEN SOLVED - SEE MY LAST UPDATE FOR WHAT WAS THE RESOLUTION.-

    Hey,

    I already monitor MS SQL and PostgreSQL with success, wanted to add MySQL.

    My environmet looks like this:

    UBUNTU: Linux version 4.15.0-48-generic (buildd@lgw01-amd64-036) (gcc version 7.3.0 (Ubuntu 7.3.0-16ubuntu3)) #51-Ubuntu SMP Wed Apr 3 08:28:49 UTC 2019
    ZABBIX: 4.0.7
    MySQL: mysql Ver 14.14 Distrib 5.7.26, for Linux (x86_64) using EditLine wrapper
    MySQL ODBC: mysql-connector-odbc-8.0.16-linux-ubuntu18.04-x86-64bit

    My odbc.ini looks like this:
    [ZABBIXDB]
    Description = ZABBIX database
    Driver = mysql
    Server = 127.0.0.1
    User = zabbix
    Password = ********
    Port = 3306
    Database = zabbix

    My odbcinst.ini looks like this:
    [mysql]
    Driver=/usr/lib/x86_64-linux-gnu/odbc/libmyodbc8w.so
    Setup=/usr/lib/x86_64-linux-gnu/odbc/libmyodbc8S.so
    UsageCount=1

    I try to run queries agains ZABBIX database itself, isql works correctly:

    root@objplzab0:/home/pjarosz_admin/mysql-connector-odbc-8.0.16-linux-ubuntu18.04-x86-64bit/bin# isql ZABBIXDB
    +---------------------------------------+
    | Connected! |
    | |
    | sql-statement |
    | help [tablename] |
    | quit |
    | |
    +---------------------------------------+
    SQL> SELECT count(*) FROM items i, hosts h WHERE i.hostid=h.hostid AND h.name='SERVER1' AND i.state=1;
    +---------------------+
    | count(*) |
    +---------------------+
    | 10 |
    +---------------------+

    However in ZABBIX in latest data I get sometihng like this:
    019-06-18 08:09:22 en_US.UTF-8
    2019-06-18 08:08:52 en_US.UTF-8
    2019-06-18 08:08:22 ??*? V
    2019-06-18 08:07:52 en_US.UTF-8
    2019-06-18 08:07:26 ??W??~
    I think I did it the same way I was doing other DB monitoring, where do I make mistake?

    Appreciate your help,
    Pawel J.
    Last edited by zaicnupagadi; 18-06-2019, 09:24.
  • Hamardaban
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • May 2019
    • 2713

    #2
    I think you have part of error message in latest data... What type of item do you use? "Zabbix agent" or "ODBC checks"? Try set "Type of information" = TEXT to see full mesage.

    Comment

    • zaicnupagadi
      Member
      Zabbix Certified SpecialistZabbix Certified Professional
      • Dec 2010
      • 73

      #3
      Got it! If it was a coding issue I would have received the same values - but I was receiving different from time to time - that meant problem might be wiht something different.


      Seems that libmyodbc8w.so was working with operating system, but NOT with ZABBIX. I was reading all the examples and in all examples was libmyodbc5w.so not 8. So I downloaded this version, changed odbcinst.ini aaaaaand.. it worked.

      So despite MySQL is recommending libmyodbc8w.so for Ubuntu 18, and this version of MySQL - it is not working with ZABBIX

      [SOLVED]

      Comment

      • Hamardaban
        Senior Member
        Zabbix Certified SpecialistZabbix Certified Professional
        • May 2019
        • 2713

        #4
        Great! Another confirmation that can help solve "strange" problems!

        Comment

        Working...