Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-21173

Special characters in the Database monitor connection string MSSQL

XMLWordPrintable

    • Team A
    • Sprint 90 (Jul 2022), Sprint 91 (Aug 2022)
    • 0.1

      Steps to reproduce:

      1. Run an MSSQL server instance where a user has special characters in the password. For example:

      docker run --privileged -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=P?;){*word' -p 1433:1433 --name=MSSQL -d mcr.microsoft.com/mssql/server:2019-latest

      2. Install the ODBC driver manager and the corresponding MSSQL ODBC driver. For example follow this guide: https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server?view=sql-server-ver15#17

      3. Create a corresponding entry in the "/etc/odbcinst.ini", for example

      [ODBC Driver 17 for SQL Server]
      Description=Microsoft ODBC Driver 17 for SQL Server
      Driver=/opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.9.so.1.1
      UsageCount=1

      4. Create a corresponding entry in the "/etc/odbc.ini", for example:

      [MSSQL2019]
      Description=Localhost MSSQL 2019
      Driver=ODBC Driver 17 for SQL Server
      Server=192.168.13.10
      Port=1433

      5. Test the connectivity with ISQL:

      run some simple query:

      6. Create a test host and add an item of type "Database monitor". Configure macro, connection string, simple query and user credentials:

      the full key:

      db.odbc.select[MSSQL-pass,,"Driver=/opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.9.so.1.1;Database=master;Server=192.168.13.10;Port=3306"]

      7. Test the item and try to get the same value as previously got with ISQL:

       

      Result:

      Expected:
      The same result as with ISQL

      Sidenotes: if at the step #1 the user password does not contain special characters, then Zabbix connects correctly and returns actual results. 

      If the Debug Level for the "odbc poller" id set to the maximum 5th level it can be seen that the password with the special characters is parsed correctly:

            nburisina Natalija Burisina (Inactive)
            asincovs Antons Sincovs
            Team A
            Votes:
            1 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: