Ad Widget

Collapse

Zabbix using "libmsodbcsql-18.2.so.1.1" instead of "libmsodbcsql-18.4.so.1.1"

Collapse
This topic has been answered.
X
X
 
  • Time
  • Show
Clear All
new posts
  • RaulChiarella
    Member
    • Apr 2021
    • 59

    #1

    Zabbix using "libmsodbcsql-18.2.so.1.1" instead of "libmsodbcsql-18.4.so.1.1"

    Hello.
    I installed the MSSQL ODBC Driver for SQL 18 following the official tutorial from Zabbix and Windows:
    - https://www.zabbix.com/documentation...es/odbc_checks
    - https://learn.microsoft.com/en-us/sq...Crhel7-offline

    I am using RHEL 9, and the driver is installed successfully but for some reason Zabbix is trying to get "libmsodbcsql-18.2.so.1.1" instead of the actual installed driver which is "/opt/microsoft/msodbcsql18/lib64/libmsodbcsql-18.4.so.1.1".
    How can I adjust Zabbix to use the correct driver instead of that "18.2" one?

    As you can see, I already have the configuration correctly and the driver is present, but Zabbix is trying a older version (2 Versions older):


    And the error in Zabbix appear as "Cannot connect to ODBC DSN: [SQL_ERROR]:[01000][0][[unixODBC][Driver Manager]Can't open lib '/opt/microsoft/msodbcsql18/lib64/libmsodbcsql-18.2.so.1.1' : file not found]" because it is trying to read a wrong file.

    Can someone help?
  • Answer selected by RaulChiarella at 12-09-2024, 16:32.
    RaulChiarella
    Member
    • Apr 2021
    • 59

    Turns out that it did'nt have nothing to do with Zabbix.
    Solution for me was executing odbcinst -j to list paths and configurations for ODBC Driver being used and I had to change the "Driver Config. File":

    - Driver Config. File: /etc/odbcinst.ini

    The driver being used and pointed in /etc/odbc.ini was set to use the driver /opt/microsoft/msodbcsql18/lib64/libmsodbcsql-18.2.so.1.1, so I changed it to 18.4 and it solved the problem.

    Comment

    • tim.mooney
      Senior Member
      • Dec 2012
      • 1427

      #2
      Originally posted by RaulChiarella
      Hello.
      I installed the MSSQL ODBC Driver for SQL 18 following the official tutorial from Zabbix and Windows:
      - https://www.zabbix.com/documentation...es/odbc_checks
      - https://learn.microsoft.com/en-us/sq...Crhel7-offline
      Those two documents are in conflict. If you followed the Windows instructions, then you deviated from the official Zabbix documentation.

      Originally posted by RaulChiarella
      I am using RHEL 9, and the driver is installed successfully but for some reason Zabbix is trying to get "libmsodbcsql-18.2.so.1.1" instead of the actual installed driver which is "/opt/microsoft/msodbcsql18/lib64/libmsodbcsql-18.4.so.1.1".
      How can I adjust Zabbix to use the correct driver instead of that "18.2" one?
      You can't (at least not easily -- there is a way, but it's very advanced). The shared library (like Windows DLLs) dependencies for an executable are recorded automatically when the executable is linked (basically the last stage of the compile/build process). The executable you have was linked against not just a different version of the library but a different application binary interface (ABI) of the library. Even if you knew the trick to alter the executable to tell it to (try) use libmsodbcsql-18.4.<whatever> instead of the shared library it was actually linked against, there's no guarantee that it would even work, since the ABI may have changed.

      Since the dependencies are recorded when the executable is linked, the "normal" way to get around a problem like this would be to recompile and relink the software in question. In your case, though, I think the package that is having the issue is the Red Hat unixODBC package, so you would potentially be opening a large can of worms if you rebuilt that to the version of llibmsodbcsql that you actually have installed.

      Originally posted by RaulChiarella
      As you can see, I already have the configuration correctly and the driver is present, but Zabbix is trying a older version (2 Versions older):
      No, you don't, because you didn't follow the Zabbix documentation. You mixed in documentation from Microsoft that contradicts the Zabbix documentation. That's why you're running into trouble.

      Uninstall the packages that the Microsoft documentation had you download and install, and re-read the section of the Zabbix documentation that talks about "freetds". Follow that section closely and you should be able to proceed.

      Comment

      • RaulChiarella
        Member
        • Apr 2021
        • 59

        #3
        Turns out that it did'nt have nothing to do with Zabbix.
        Solution for me was executing odbcinst -j to list paths and configurations for ODBC Driver being used and I had to change the "Driver Config. File":

        - Driver Config. File: /etc/odbcinst.ini

        The driver being used and pointed in /etc/odbc.ini was set to use the driver /opt/microsoft/msodbcsql18/lib64/libmsodbcsql-18.2.so.1.1, so I changed it to 18.4 and it solved the problem.

        Comment

        Working...