Skip to content

Commit

Permalink
pull in changes from upstream pr mleinart#3
Browse files Browse the repository at this point in the history
  • Loading branch information
wyattwalter committed Oct 23, 2014
1 parent f7c5455 commit 926a4bb
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions haproxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def read_callback():
return

for key,value in info.items():
key_prefix = None
key_prefix = ''
key_root = key
if not value in METRIC_TYPES:
try:
Expand All @@ -169,12 +169,9 @@ def read_callback():
continue

key_root, val_type = METRIC_TYPES[key_root]
if key_prefix:
key_name = METRIC_DELIM.join([key_prefix, key_root])
else:
key_name = key_root
val = collectd.Values(plugin=NAME, type=val_type)
val.type_instance = key_name
val.plugin_instance = key_prefix
val.type_instance = key_root
val.values = [ value ]
val.dispatch()

Expand All @@ -190,4 +187,4 @@ def logger(t, msg):
collectd.notice('%s: %s' % (NAME, msg))

collectd.register_config(configure_callback)
collectd.register_read(read_callback)
collectd.register_read(read_callback)

0 comments on commit 926a4bb

Please sign in to comment.