This repository was archived by the owner on Jun 2, 2021. It is now read-only.
File tree 3 files changed +12
-3
lines changed
newrelic_plugin_agent/plugins
3 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -231,10 +231,14 @@ Configuration Example
231
231
host: localhost
232
232
port: 5984
233
233
#verify_ssl_cert: true
234
+ #username: foo
235
+ #password: bar
234
236
- name: localhost
235
237
host: localhost
236
238
port: 5984
237
239
#verify_ssl_cert: true
240
+ #username: foo
241
+ #password: bar
238
242
239
243
edgecast:
240
244
- name: My Edgecase Account
Original file line number Diff line number Diff line change @@ -18,6 +18,8 @@ Application:
18
18
# host: localhost
19
19
# verify_ssl_cert: true
20
20
# port: 5984
21
+ # username: foo
22
+ # password: bar
21
23
22
24
# edgecast:
23
25
# name: My Edgecase Account
Original file line number Diff line number Diff line change @@ -78,10 +78,13 @@ def fetch_data(self):
78
78
:rtype: dict
79
79
80
80
"""
81
+ kwargs = {'url' : self .couchdb_stats_url ,
82
+ 'verify' : self .config .get ('verify_ssl_cert' , True )}
83
+ if 'username' in self .config and 'password' in self .config :
84
+ kwargs ['auth' ] = (self .config ['username' ], self .config ['password' ])
85
+
81
86
try :
82
- response = requests .get (self .couchdb_stats_url ,
83
- verify = self .config .get ('verify_ssl_cert' ,
84
- True ))
87
+ response = requests .get (** kwargs )
85
88
except requests .ConnectionError as error :
86
89
LOGGER .error ('Error polling CouchDB: %s' , error )
87
90
return {}
You can’t perform that action at this time.
0 commit comments