diff --git a/.werks/15517.md b/.werks/15517.md new file mode 100644 index 00000000000..4cb32f8c1ad --- /dev/null +++ b/.werks/15517.md @@ -0,0 +1,20 @@ +[//]: # (werk v2) +# check_cert: Fixed metrics in output + +key | value +---------- | --- +date | 2024-09-23T14:48:43+00:00 +version | 2.4.0b1 +class | fix +edition | cre +component | checks +level | 2 +compatible | yes + +The active check for monitoring certificates produces two metrics by now. +These metrics have been written in a broken format and therefore never +been created. This is now fixed and both metrics are now available. + +The affected metrics are +* certificate_remaining_validity (is also used for Perf-O-Meter) +* overall_execution_time diff --git a/cmk/plugins/collection/graphing/check_cert_certificate_remaining_validity.py b/cmk/plugins/collection/graphing/check_cert_certificate_remaining_validity.py new file mode 100644 index 00000000000..b3683955e98 --- /dev/null +++ b/cmk/plugins/collection/graphing/check_cert_certificate_remaining_validity.py @@ -0,0 +1,24 @@ +#!/usr/bin/env python3 +# Copyright (C) 2024 Checkmk GmbH - License: GNU General Public License v2 +# This file is part of Checkmk (https://checkmk.com). It is subject to the terms and +# conditions defined in the file COPYING, which is part of this source code package. + +from cmk.graphing.v1 import metrics, perfometers, Title + +UNIT_TIME = metrics.Unit(metrics.TimeNotation()) + +metric_certificate_remaining_validity = metrics.Metric( + name="certificate_remaining_validity", + title=Title("Remaining certificate validity time"), + unit=UNIT_TIME, + color=metrics.Color.YELLOW, +) + +perfometer_certificate_remaining_validity = perfometers.Perfometer( + name="certificate_remaining_validity", + focus_range=perfometers.FocusRange( + perfometers.Closed(0), + perfometers.Open(15552000), # 180 days + ), + segments=["certificate_remaining_validity"], +) diff --git a/cmk/plugins/collection/graphing/check_cert_overall_response_time.py b/cmk/plugins/collection/graphing/check_cert_overall_response_time.py new file mode 100644 index 00000000000..05d58cbc95d --- /dev/null +++ b/cmk/plugins/collection/graphing/check_cert_overall_response_time.py @@ -0,0 +1,15 @@ +#!/usr/bin/env python3 +# Copyright (C) 2024 Checkmk GmbH - License: GNU General Public License v2 +# This file is part of Checkmk (https://checkmk.com). It is subject to the terms and +# conditions defined in the file COPYING, which is part of this source code package. + +from cmk.graphing.v1 import metrics, Title + +UNIT_TIME = metrics.Unit(metrics.TimeNotation()) + +metric_overall_response_time = metrics.Metric( + name="overall_response_time", + title=Title("Overall response time"), + unit=UNIT_TIME, + color=metrics.Color.ORANGE, +)