Skip to content
This repository has been archived by the owner on Dec 8, 2023. It is now read-only.

add Proxy configuration directive #19

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lib/collectd-librato.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,10 @@ def librato_config(c):
msg = '%s: Invalid value for FlushIntervalSecs: %s' % \
(plugin_name, val)
raise Exception(msg)
elif child.key == 'Proxy':
proxy = urllib2.ProxyHandler({'https': val, 'http': val})
opener = urllib2.build_opener(proxy)
urllib2.install_opener(opener)

if not config.has_key('api_token'):
raise Exception('APIToken not defined')
Expand Down