Skip to content

Commit

Permalink
Merge pull request #3168 from DataDog/hamano_riak_security
Browse files Browse the repository at this point in the history
Hamano riak security
  • Loading branch information
hush-hush authored Feb 2, 2017
2 parents c4d1e8e + 14563ca commit 1ecbe45
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion checks.d/riak.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,15 @@ def check(self, instance):
url = instance['url']
default_timeout = self.init_config.get('default_timeout', 5)
timeout = float(instance.get('timeout', default_timeout))
cacert = instance.get('cacert', None)
disable_cert_verify = instance.get('disable_cert_verify', False)
tags = instance.get('tags', [])
service_check_tags = tags + ['url:%s' % url]

try:
h = Http(timeout=timeout)
h = Http(timeout=timeout,
ca_certs=cacert,
disable_ssl_certificate_validation=disable_cert_verify)
resp, content = h.request(url, "GET")
except (socket.timeout, socket.error, HttpLib2Error) as e:
self.service_check(self.SERVICE_CHECK_NAME, AgentCheck.CRITICAL,
Expand Down
2 changes: 2 additions & 0 deletions conf.d/riak.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ init_config:

instances:
- url: http://127.0.0.1:8098/stats
# cacert: /path/to/ca.pem
# disable_cert_verify: false
# tags:
# - optional_tag1
# - optional_tag2

0 comments on commit 1ecbe45

Please sign in to comment.