Skip to content
Snippets Groups Projects
Commit 81c76f78 authored by ale's avatar ale
Browse files

Ignore SMART test statuses that aren't complete yet

Prevent alerting when SMART tests haven't run yet.
parent 6ba74954
No related branches found
No related tags found
No related merge requests found
Pipeline #86535 failed
......@@ -221,6 +221,9 @@ def collect_self_test_status(device, data):
(test['lifetime_hours'] > most_recent_test_by_type[key]['lifetime_hours']):
most_recent_test_by_type[key] = test
for test in most_recent_test_by_type.values():
if 'passed' not in test['status']:
# Possibly still ongoing.
continue
labels = {'test': to_label_value(test['type']['string'])}
labels.update(device.labels)
yield Gauge('self_test_status', labels, test['status']['passed'])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment