Skip to content

Commit

Permalink
Merge pull request #11 from signalfx/SWAT-3215
Browse files Browse the repository at this point in the history
fix master link status
  • Loading branch information
dloucasfx authored Jun 9, 2021
2 parents ddc7979 + 950778f commit 6377237
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion redis_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,17 @@ def dispatch_value(self, value, type, plugin_instance=None, type_instance=None,
try:
value = int(value)
except ValueError:
value = float(value)
try:
value = float(value)
except ValueError:
if type_instance == "master_link_status":
if value == "up":
value = 1
else:
value = 0
else:
collectd.warning("redis_info plugin: could not cast value %s for instance %s " % (value, type_instance))
return

self.log_verbose("Sending value: %s=%s (%s)" % (type_instance, value, dimensions))

Expand Down

0 comments on commit 6377237

Please sign in to comment.