question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MSSQL SQLDriverConnect

See original GitHub issue

Hello,

is there a way how to make MSSQL server drivers working in datadog-agent docker image?

I have enabled integration using: https://docs.datadoghq.com/integrations/sqlserver/ ,but I get this:

sqlserver (1.16.2)
    ------------------
      Instance ID: sqlserver:94bb9d1db5faf8f2 [ERROR]
      Configuration Source: file:/etc/datadog-agent/conf.d/sqlserver.yaml
      Total Runs: 191
      Metric Samples: Last Run: 0, Total: 0
      Events: Last Run: 0, Total: 0
      Service Checks: Last Run: 1, Total: 191
      Average Execution Time : 3ms
      Last Execution Date : 2020-05-06 07:05:04.000000 UTC
      Last Successful Execution Date : Never
      Error: Unable to connect to SQL Server for instance %REDACTED%,1433 - master: Error('01000', "[01000] [unixODBC][Driver Manager]Can't open lib 'SQL Server' : file not found (0) (SQLDriverConnect)")
      Traceback (most recent call last):
        File "/opt/datadog-agent/embedded/lib/python3.8/site-packages/datadog_checks/base/checks/base.py", line 713, in run
          self.check(instance)
        File "/opt/datadog-agent/embedded/lib/python3.8/site-packages/datadog_checks/sqlserver/sqlserver.py", line 467, in check
          self.do_perf_counter_check(instance)
        File "/opt/datadog-agent/embedded/lib/python3.8/site-packages/datadog_checks/sqlserver/sqlserver.py", line 482, in do_perf_counter_check
          with self.open_managed_db_connections(instance, self.DEFAULT_DB_KEY):
        File "/opt/datadog-agent/embedded/lib/python3.8/contextlib.py", line 113, in __enter__
          return next(self.gen)
        File "/opt/datadog-agent/embedded/lib/python3.8/site-packages/datadog_checks/sqlserver/sqlserver.py", line 612, in open_managed_db_connections
          self.open_db_connections(instance, db_key, db_name)
        File "/opt/datadog-agent/embedded/lib/python3.8/site-packages/datadog_checks/sqlserver/sqlserver.py", line 669, in open_db_connections
          raise_from(SQLConnectionError(message), None)
        File "<string>", line 3, in raise_from
      datadog_checks.sqlserver.sqlserver.SQLConnectionError: Unable to connect to SQL Server for instance %REDACTED%,1433 - master: Error('01000', "[01000] [unixODBC][Driver Manager]Can't open lib 'SQL Server' : file not found (0) (SQLDriverConnect)")

I tried this: https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server?view=sql-server-2017

But there is a lot of broken stuff (for example broken dependency on package odbcinst1debian2)

I am using helm chart for installing DD agent - https://github.com/helm/charts/tree/master/stable/datadog

Motivation is to have this metric: sqlserver.stats.lock_waits from MSSQL server in DataDog.

Please advise.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
AlexandreYangcommented, May 27, 2020

@MilanDasek The PRs fixing this issue have been merged. The change will be shipped with Agent 7.21 (Didn’t make it for 7.20).

PRs:

1reaction
MilanDasekcommented, May 7, 2020

@florimondmanca

this is not supported by the chart - I cannot insert there

command: ["/bin/sh"]
args: ["-c", "apt-get update && apt-get install -y tdsodbc unixodbc-dev"]

therefore I would like to ask DataDog to include MSSQL drives in their agent image: https://hub.docker.com/r/datadog/agent

so then MSSQL integration should work

Read more comments on GitHub >

github_iconTop Results From Across the Web

SQLDriverConnect Function - ODBC API Reference
SQLDriverConnect is an alternative to SQLConnect. It supports data sources that require more connection information than the three arguments ...
Read more >
SQLDriverConnect()--Connect without Using a Data Source ...
SQLDriverConnect () uses a connection string instead of an ODBC DSN definition; the odbc.ini file is ... Type of database (Ingres, SQLServer, Oracle,...
Read more >
unixODBC-MSSQL/SQLDriverConnect.c at master - GitHub
unixODBC Driver Manager for the Microsoft ODBC Driver - unixODBC-MSSQL/SQLDriverConnect.c at master · Azure/unixODBC-MSSQL.
Read more >
Microsoft SQL Server ODBC Driver Connection Strings
If your SQL Server listens on a non-default port you can specify that using the servername,xxxx syntax (note the comma, it's not a...
Read more >
MSSQL connection with official driver - Google Groups
I have to work with MSSQL database (on azure) and i've just installed the Microsoft ... open lib 'SQL Server' : file not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found