Skip to content

Commit

Permalink
15517 FIX check_cert: Fixed metrics in output
Browse files Browse the repository at this point in the history
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

CMK-17766

Change-Id: Icce810f87375e4b25e1662ec75068b89c66f193b
  • Loading branch information
godspeed-you committed Sep 24, 2024
1 parent c241ab1 commit 624d4de
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .werks/15517.md
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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"],
)
Original file line number Diff line number Diff line change
@@ -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,
)

0 comments on commit 624d4de

Please sign in to comment.