Skip to content

Commit

Permalink
Add description to threshold alarms
Browse files Browse the repository at this point in the history
  • Loading branch information
johannaengland committed Nov 2, 2023
1 parent e297772 commit 891607e
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ Metric: {{ metric }}
Time: {{ time }}
Value: {{ measured_value }}
Threshold: {% firstof clear alert %}
{% if description %}Description: {{ description }}{% endif %}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{{ metric }} cleared at {{ measured_value }} {% firstof clear alert %} on {{ time }}.
{{ metric }} cleared at {{ measured_value }} {% firstof clear alert %} on {{ time }}{% if description %} ({{ description }}){% endif %}.
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ Metric: {{ metric }}
Time: {{ time }}
Value: {{ measured_value }}
Threshold: {{ alert|safe }}
{% if description %}Description: {{ description }}{% endif %}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{{ metric }} exceeded at {{ measured_value }} {{ alert|safe }} on {{ time }}.
{{ metric }} exceeded at {{ measured_value }} {{ alert|safe }} on {{ time }}{% if description %} ({{ description }}){% endif %}.
2 changes: 2 additions & 0 deletions python/nav/thresholdmon.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@ def make_event(start, rule, metric, value):
)
if rule.clear:
varmap['clear'] = str(rule.clear)
if rule.description:
varmap['description'] = rule.description
_add_subject_details(event, metric, varmap)

event.save()
Expand Down

0 comments on commit 891607e

Please sign in to comment.