Skip to content

Commit

Permalink
Merge pull request #10 from shinken-monitoring/revert-9-master
Browse files Browse the repository at this point in the history
Revert "Added API key parameter so this plugin works with hostedgraphite...
  • Loading branch information
Seb-Solon committed Mar 30, 2015
2 parents 4a59f84 + b7abd1a commit d241323
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 25 deletions.
3 changes: 1 addition & 2 deletions etc/modules/graphite.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,5 @@ define module {
# the timestamp associated to the data will be 0
# Basically this ignore small latency in order to have regular interval between data.
# We skip an Graphite limitation that expect a specific timestamp range for data.
#ignore_latency_limit 15 ;
#hosted_graphite_api_key xxxx-aaaa-bbbb-cccc-aaaa ;
#ignore_latency_limit 15 ;
}
29 changes: 6 additions & 23 deletions module/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ def __init__(self, modconf):
self.multival = re.compile(r'_(\d+)$')
self.chunk_size = 200
self.max_chunk_size = 100000
self.hosted_graphite_api_key = getattr(modconf, 'hosted_graphite_api_key', '')

# optional "sub-folder" in graphite to hold the data of a specific host
self.graphite_data_source = \
Expand Down Expand Up @@ -199,17 +198,10 @@ def manage_service_check_result_brok(self, b):
#except UnicodeEncodeError:
# pass

path_elements = []
if self.hosted_graphite_api_key:
path_elements.append(self.hosted_graphite_api_key)

if self.graphite_data_source:
path_elements.append(self.graphite_data_source)

path_elements.append(hname)

path = '.'.join(path_elements)

path = '.'.join((hname, self.graphite_data_source, desc))
else:
path = '.'.join((hname, desc))

if self.use_pickle:
# Buffer the performance data lines
Expand Down Expand Up @@ -265,19 +257,10 @@ def manage_host_check_result_brok(self, b):
#except UnicodeEncodeError:
# pass

# If present prepend API key to value as per http://www.hostedgraphite.com
path_elements = []

if self.hosted_graphite_api_key:
path_elements.append(self.hosted_graphite_api_key)

if self.graphite_data_source:
path_elements.append(self.graphite_data_source)

path_elements.append(hname)

path = '.'.join(path_elements)

path = '.'.join((hname, self.graphite_data_source))
else:
path = hname

if self.use_pickle:
# Buffer the performance data lines
Expand Down

0 comments on commit d241323

Please sign in to comment.