Skip to content

Commit 8e3db41

Browse files
committed
20143 FIX Azure VM and database CPU utilization: configured thresholds now take effect
The warning and critical levels configured for the following services of the current Azure integration (`azure_v2`) had no effect and the services kept using their built-in default levels: * **Azure/VM CPU Utilization** * **Azure/DB for PostgreSQL CPU** * **Azure/DB for MySQL CPU** The checks now use the correct params key. SUP-29577 Change-Id: I230483bfe0ddf88baff82682d047287c8f0938a9
1 parent de98d0c commit 8e3db41

12 files changed

Lines changed: 52 additions & 14 deletions

File tree

.werks/20143.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
[//]: # (werk v3)
2+
# Azure VM and database CPU utilization: configured thresholds now take effect
3+
4+
key | value
5+
---------- | ---
6+
date | 2026-06-24T15:21:41.397087+00:00
7+
version | 2.5.0p8
8+
class | fix
9+
edition | community
10+
component | checks
11+
level | 1
12+
compatible | no
13+
14+
The warning and critical levels configured for the following services of the
15+
current Azure integration (`azure_v2`) had no effect; the services always used
16+
their built-in default levels:
17+
18+
- Azure/VM CPU Utilization
19+
- Azure/DB for PostgreSQL CPU
20+
- Azure/DB for MySQL CPU
21+
22+
The check plugins read the levels from the wrong parameter key, so the
23+
thresholds configured via the _CPU utilization (single value)_ rule (previously
24+
_CPU utilization for appliances_) were silently ignored.
25+
26+
The check plugins now read the levels from the correct key, so this rule takes
27+
effect for the affected services.
28+
29+
Advisory: if you have already configured the _CPU utilization (single value)_
30+
rule for hosts running these services, the levels now apply on the next check
31+
cycle. Review the rule (and the affected services) after
32+
updating if you want to avoid unexpected state changes.
33+
34+
Additionally, the check manuals for these services previously referred to the
35+
wrong rule, _CPU utilization_ (the per-item variant), which these services
36+
cannot use. If you created that rule expecting it to configure these services,
37+
it never took effect and is now orphaned. Remove it and configure the levels
38+
with the _CPU utilization (single value)_ rule instead.

cmk/plugins/azure_v2/agent_based/azure_mysql.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def check_azure_mysql_memory(
7070
),
7171
check_function=check_cpu(),
7272
check_ruleset_name="cpu_utilization",
73-
check_default_parameters={"levels": (65.0, 90.0)},
73+
check_default_parameters={"util": (65.0, 90.0)},
7474
)
7575

7676

cmk/plugins/azure_v2/agent_based/azure_postgresql.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def check_azure_postgresql_memory(
7575
),
7676
check_function=check_cpu(),
7777
check_ruleset_name="cpu_utilization",
78-
check_default_parameters={"levels": (65.0, 90.0)},
78+
check_default_parameters={"util": (65.0, 90.0)},
7979
)
8080

8181

cmk/plugins/azure_v2/agent_based/azure_virtual_machine.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ def check_azure_vm_cpu_utilization(
155155
"util",
156156
"CPU utilization",
157157
render.percent,
158-
upper_levels_param="levels",
158+
upper_levels_param="util",
159159
)
160160
]
161161
)(params, section)
@@ -168,7 +168,7 @@ def check_azure_vm_cpu_utilization(
168168
discovery_function=discover_azure_vm_cpu_utilization,
169169
check_function=check_azure_vm_cpu_utilization,
170170
check_ruleset_name="cpu_utilization",
171-
check_default_parameters={"levels": (65.0, 90.0)},
171+
check_default_parameters={"util": (65.0, 90.0)},
172172
)
173173

174174

cmk/plugins/azure_v2/agent_based/lib.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ def check_cpu() -> CheckFunctionWithoutItem:
462462
"util",
463463
"CPU utilization",
464464
render.percent,
465-
upper_levels_param="levels",
465+
upper_levels_param="util",
466466
)
467467
]
468468
)

cmk/plugins/azure_v2/checkman/azure_v2_mysql_cpu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ license: GPLv2
55
distribution: check_mk
66
description:
77
This check reports the cpu utilization in percent.
8-
You can configure levels using the rule "CPU Utilization".
8+
You can configure levels using the rule "CPU utilization (single value)".
99

1010
discovery:
1111
One service is created for each database if the required metric

cmk/plugins/azure_v2/checkman/azure_v2_postgresql_cpu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ license: GPLv2
55
distribution: check_mk
66
description:
77
This check reports the cpu utilization in percent.
8-
You can configure levels using the rule "CPU Utilization".
8+
You can configure levels using the rule "CPU utilization (single value)".
99

1010
discovery:
1111
One service is created for each database if the required metric

cmk/plugins/azure_v2/checkman/azure_v2_vm_cpu_utilization

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ description:
77
This check provides information about VM CPU utilization in
88
the Microsoft Azure cloud.
99

10-
The thresholds can be configured using the rule "CPU Utilization".
10+
The thresholds can be configured using the rule "CPU utilization (single value)".
1111

1212
discovery:
1313
One service is created on every VM host. The option

tests/unit/cmk/plugins/azure_v2/agent_based/test_azure.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -946,7 +946,7 @@ def test_check_memory(
946946
(
947947
PARSED_RESOURCE,
948948
"checkmk-mysql-server",
949-
{"levels": (0.0, 0.0)},
949+
{"util": (0.0, 0.0)},
950950
[
951951
Result(state=State.CRIT, summary="CPU utilization: 0% (warn/crit at 0%/0%)"),
952952
Metric("util", 0.0, levels=(0.0, 0.0)),

tests/unit/cmk/plugins/azure_v2/agent_based/test_azure_mysql.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ def test_check_network(
454454
),
455455
},
456456
),
457-
{"levels": (80.0, 90.0)},
457+
{"util": (80.0, 90.0)},
458458
[
459459
Result(state=State.OK, summary="CPU utilization: 50.00%"),
460460
Metric("util", 50.0, levels=(80.0, 90.0)),
@@ -477,7 +477,7 @@ def test_check_network(
477477
),
478478
},
479479
),
480-
{"levels": (80.0, 90.0)},
480+
{"util": (80.0, 90.0)},
481481
[
482482
Result(
483483
state=State.CRIT,

0 commit comments

Comments
 (0)