diff --git a/checks.d/sqlserver.py b/checks.d/sqlserver.py index ada106c046..f6791f178d 100644 --- a/checks.d/sqlserver.py +++ b/checks.d/sqlserver.py @@ -48,7 +48,8 @@ def _conn_string(self, host, username, password, database): conn_str += 'User ID=%s;' % (username) if password: conn_str += 'Password=%s;' % (password) - + if not username and not password: + conn_str += 'Integrated Security=SSPI;' return conn_str def check(self, instance): diff --git a/conf.d/sqlserver.yaml.example b/conf.d/sqlserver.yaml.example index a7084023db..5e0e95b421 100644 --- a/conf.d/sqlserver.yaml.example +++ b/conf.d/sqlserver.yaml.example @@ -4,6 +4,10 @@ init_config: # `sys.dm_os_performance_counters` table. You can easily add additional # metrics by following the custom_metrics structure shown below. # + # In order to connect to SQL Server either enable SQL Authentication and + # specify a username or password below. If you do not specify a username + # or password then we will connect using integrated authentication. + # #custom_metrics: # # This is a basic custom metric. There is not instance assicated with