Skip to content

Commit

Permalink
17281 FIX Skip creation of invalid metric
Browse files Browse the repository at this point in the history
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
  • Loading branch information
loocars committed Feb 17, 2025
1 parent 10cac67 commit fa3af7b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .werks/17281.md
Original file line number Diff line number Diff line change
@@ -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.
3 changes: 3 additions & 0 deletions active_checks/check_notify_count
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit fa3af7b

Please sign in to comment.