From f8e06c4533392bef1c2a6a4b0abab9afbd40e57d Mon Sep 17 00:00:00 2001 From: jamescrowley Date: Tue, 20 Aug 2013 21:27:16 +0100 Subject: [PATCH 1/2] Update sqlserver.py to default to integrated security if no username/password --- checks.d/sqlserver.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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): From 0e08e248f3d455755635dd6fceb40c837e789271 Mon Sep 17 00:00:00 2001 From: jamescrowley Date: Tue, 20 Aug 2013 21:31:56 +0100 Subject: [PATCH 2/2] Updating sqlserver.yaml.example with explanation of new behavior --- conf.d/sqlserver.yaml.example | 4 ++++ 1 file changed, 4 insertions(+) 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