From fa3af7befec6d5c34dd2d5dae56e79bb34cd1418 Mon Sep 17 00:00:00 2001 From: Lukas Lengler Date: Thu, 13 Feb 2025 14:28:45 +0100 Subject: [PATCH] 17281 FIX Skip creation of invalid metric When a user without an ID was present in the monitoring the `check_notify_count` active check would be able to create an invalid metric called `_num`. Now this is no longer possible and the metric is just being skipped. SUP-19694 Change-Id: If01fba2a8440ccbe2114997d50a3f67deb815df7 --- .werks/17281.md | 17 +++++++++++++++++ active_checks/check_notify_count | 3 +++ 2 files changed, 20 insertions(+) create mode 100644 .werks/17281.md diff --git a/.werks/17281.md b/.werks/17281.md new file mode 100644 index 00000000000..840a21c1a79 --- /dev/null +++ b/.werks/17281.md @@ -0,0 +1,17 @@ +[//]: # (werk v2) +# Skip creation of invalid metric + +key | value +---------- | --- +date | 2025-02-13T13:26:51+00:00 +version | 2.5.0b1 +class | fix +edition | cre +component | checks +level | 1 +compatible | yes + +When a user without an ID was present in the monitoring the `check_notify_count` active +check would be able to create an invalid metric called `_num`. + +Now this is no longer possible and the metric is just being skipped. diff --git a/active_checks/check_notify_count b/active_checks/check_notify_count index 91dddc37491..9f502ef0923 100755 --- a/active_checks/check_notify_count +++ b/active_checks/check_notify_count @@ -87,6 +87,9 @@ details = [] num_users = 0 raw_notifications = 0 for contact_name, num in c.query_table(query): + # This results in an invalid metric and should therefore be skipped. + if contact_name == "": + continue if contact_name == "check-mk-notify": raw_notifications += num else: