This repository was archived by the owner on Jun 2, 2021. It is now read-only.
  
  
  
  
    
    
    
      
    
  
  
    
File tree Expand file tree Collapse file tree 3 files changed +12
-3
lines changed 
newrelic_plugin_agent/plugins Expand file tree Collapse file tree 3 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -231,10 +231,14 @@ Configuration Example
231231            host: localhost 
232232            port: 5984 
233233            #verify_ssl_cert: true 
234+             #username: foo 
235+             #password: bar 
234236         -  name: localhost 
235237            host: localhost 
236238            port: 5984 
237239            #verify_ssl_cert: true 
240+             #username: foo 
241+             #password: bar 
238242
239243      edgecast: 
240244        - name: My Edgecase Account 
Original file line number Diff line number Diff line change @@ -18,6 +18,8 @@ Application:
1818  #   host: localhost
1919  #   verify_ssl_cert: true
2020  #   port: 5984
21+   #   username: foo
22+   #  password: bar
2123
2224  # edgecast:
2325  #   name: My Edgecase Account
Original file line number Diff line number Diff line change @@ -78,10 +78,13 @@ def fetch_data(self):
7878        :rtype: dict 
7979
8080        """ 
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+ 
8186        try :
82-             response  =  requests .get (self .couchdb_stats_url ,
83-                                     verify = self .config .get ('verify_ssl_cert' ,
84-                                                            True ))
87+             response  =  requests .get (** kwargs )
8588        except  requests .ConnectionError  as  error :
8689            LOGGER .error ('Error polling CouchDB: %s' , error )
8790            return  {}
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments