Merge pull request #17 from billmoritz/metrics-fix

Return metrics no matter the result
This commit is contained in:
Drew Kerrigan 2015-08-31 12:55:17 -04:00
commit ea7edf5d01

View File

@ -263,9 +263,10 @@ if __name__ == "__main__":
processor = JsonRuleProcessor(data, args) processor = JsonRuleProcessor(data, args)
is_alive, reason = processor.isAlive() is_alive, reason = processor.isAlive()
if is_alive: # Gather metrics for display
# Rules all passed, attempt to get performance data
nagios.performance_data = processor.getMetrics() nagios.performance_data = processor.getMetrics()
if is_alive:
nagios.ok("Status OK.") nagios.ok("Status OK.")
else: else:
nagios.warning("Status check failed, reason:%s" % reason) nagios.warning("Status check failed, reason:%s" % reason)