diff --git a/python/nav/etc/alertmsg/thresholdState/belowThreshold-email.txt b/python/nav/etc/alertmsg/thresholdState/belowThreshold-email.txt index fb2b4101c4..d46ccd5b6d 100644 --- a/python/nav/etc/alertmsg/thresholdState/belowThreshold-email.txt +++ b/python/nav/etc/alertmsg/thresholdState/belowThreshold-email.txt @@ -6,3 +6,4 @@ Metric: {{ metric }} Time: {{ time }} Value: {{ measured_value }} Threshold: {% firstof clear alert %} +{% if description %}Description: {{ description }}{% endif %} diff --git a/python/nav/etc/alertmsg/thresholdState/belowThreshold-sms.txt b/python/nav/etc/alertmsg/thresholdState/belowThreshold-sms.txt index 4bb19e5195..5a3536199d 100644 --- a/python/nav/etc/alertmsg/thresholdState/belowThreshold-sms.txt +++ b/python/nav/etc/alertmsg/thresholdState/belowThreshold-sms.txt @@ -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 %}. diff --git a/python/nav/etc/alertmsg/thresholdState/exceededThreshold-email.txt b/python/nav/etc/alertmsg/thresholdState/exceededThreshold-email.txt index 08132b4013..e889d46aa5 100644 --- a/python/nav/etc/alertmsg/thresholdState/exceededThreshold-email.txt +++ b/python/nav/etc/alertmsg/thresholdState/exceededThreshold-email.txt @@ -6,3 +6,4 @@ Metric: {{ metric }} Time: {{ time }} Value: {{ measured_value }} Threshold: {{ alert|safe }} +{% if description %}Description: {{ description }}{% endif %} diff --git a/python/nav/etc/alertmsg/thresholdState/exceededThreshold-sms.txt b/python/nav/etc/alertmsg/thresholdState/exceededThreshold-sms.txt index f55cff509a..79dcf4bdf2 100644 --- a/python/nav/etc/alertmsg/thresholdState/exceededThreshold-sms.txt +++ b/python/nav/etc/alertmsg/thresholdState/exceededThreshold-sms.txt @@ -1 +1 @@ -{{ metric }} exceeded at {{ measured_value }} {{ alert|safe }} on {{ time }}. +{{ metric }} exceeded at {{ measured_value }} {{ alert|safe }} on {{ time }}{% if description %} ({{ description }}){% endif %}. diff --git a/python/nav/thresholdmon.py b/python/nav/thresholdmon.py index 7ded29de10..c325dcea1e 100644 --- a/python/nav/thresholdmon.py +++ b/python/nav/thresholdmon.py @@ -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()