Commit 8d8ae295 authored by Patrick Godwin's avatar Patrick Godwin

serve.py: fix issue with nagios check when using threshold checks or when showing critical status

parent a3cd90c4
Pipeline #81151 failed with stages
in 3 minutes and 1 second
......@@ -429,13 +429,13 @@ def serve_nagios(check):
if bad_status:
if alert_type == 'heartbeat':
text_status = "{num_tags} {alert_tag} more than {lookback} seconds behind".format(
alert_tag=nagios_config['alert_settings']['tag_key'],
alert_tag=schema['tag_key'],
num_tags=bad_status,
lookback=duration,
)
elif alert_type == 'threshold':
text_status = "{num_tags} {alert_tag} above {column} threshold = {threshold} {units} from gps times: {start} - {end}".format(
alert_tag=nagios_config['alert_settings']['tag_key'],
alert_tag=schema['tag_key'],
threshold=nagios_config['alert_settings']['threshold'],
units=nagios_config['alert_settings']['threshold_units'],
num_tags=bad_status,
......@@ -449,7 +449,7 @@ def serve_nagios(check):
text_status = "OK: Max delay: {delay} seconds".format(delay=max(alert_values))
elif alert_type == 'threshold':
text_status = "OK: No {alert_tag}s above {column} threshold = {threshold} {units} from gps times: {start} - {end}".format(
alert_tag=nagios_config['alert_settings']['tag_key'],
alert_tag=schema['tag_key'],
threshold=nagios_config['alert_settings']['threshold'],
units=nagios_config['alert_settings']['threshold_units'],
column=measurement,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment