Skip to content

Commit 8adcaa4

Browse files
committed
return one unified rule
1 parent dbba9d4 commit 8adcaa4

3 files changed

Lines changed: 20 additions & 69 deletions

File tree

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1212
### Changed
1313

1414
### Fixed
15+
- return one unified rule
1516

1617
## 0.1.3 - 2025-09-08
1718
## 0.1.2 - 2025-09-08

local/lib/python3/cmk_addons/plugins/oposs_wiseways_ups/agent_based/oposs_wiseways_ups.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ def check_oposs_wiseways_ups_battery(
360360
sections=["oposs_wiseways_ups"],
361361
discovery_function=discover_oposs_wiseways_ups_battery,
362362
check_function=check_oposs_wiseways_ups_battery,
363-
check_ruleset_name="oposs_wiseways_ups_battery",
363+
check_ruleset_name="oposs_wiseways_ups",
364364
check_default_parameters={
365365
"battery_charge_lower": ("fixed", (20.0, 10.0)),
366366
"battery_runtime_lower": ("fixed", (600.0, 300.0)), # 10min, 5min in seconds
@@ -432,7 +432,7 @@ def check_oposs_wiseways_ups_power(
432432
sections=["oposs_wiseways_ups"],
433433
discovery_function=discover_oposs_wiseways_ups_power,
434434
check_function=check_oposs_wiseways_ups_power,
435-
check_ruleset_name="oposs_wiseways_ups_power",
435+
check_ruleset_name="oposs_wiseways_ups",
436436
check_default_parameters={
437437
"input_voltage_upper": ("fixed", (250.0, 260.0)),
438438
"input_voltage_lower": ("fixed", (210.0, 200.0)),
@@ -484,7 +484,7 @@ def check_oposs_wiseways_ups_load(
484484
sections=["oposs_wiseways_ups"],
485485
discovery_function=discover_oposs_wiseways_ups_load,
486486
check_function=check_oposs_wiseways_ups_load,
487-
check_ruleset_name="oposs_wiseways_ups_load",
487+
check_ruleset_name="oposs_wiseways_ups",
488488
check_default_parameters={
489489
"load_upper": ("fixed", (80.0, 90.0)),
490490
},
@@ -537,7 +537,7 @@ def check_oposs_wiseways_ups_frequency(
537537
sections=["oposs_wiseways_ups"],
538538
discovery_function=discover_oposs_wiseways_ups_frequency,
539539
check_function=check_oposs_wiseways_ups_frequency,
540-
check_ruleset_name="oposs_wiseways_ups_frequency",
540+
check_ruleset_name="oposs_wiseways_ups",
541541
check_default_parameters={
542542
"frequency_upper": ("fixed", (51.0, 52.0)),
543543
"frequency_lower": ("fixed", (49.0, 48.0)),

local/lib/python3/cmk_addons/plugins/oposs_wiseways_ups/rulesets/oposs_wiseways_ups.py

Lines changed: 15 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,13 @@
1919
)
2020

2121

22-
# Battery monitoring ruleset
23-
def _form_spec_oposs_wiseways_ups_battery():
22+
# Combined UPS monitoring ruleset for all services
23+
def _form_spec_oposs_wiseways_ups():
2424
return Dictionary(
25-
title=Title("OPOSS Wiseways UPS Battery Monitoring"),
26-
help_text=Help("Configure thresholds for UPS battery monitoring"),
25+
title=Title("OPOSS Wiseways UPS Monitoring"),
26+
help_text=Help("Configure thresholds for all UPS monitoring services"),
2727
elements={
28+
# Battery parameters
2829
"battery_charge_lower": DictElement(
2930
parameter_form=SimpleLevels(
3031
title=Title("Battery charge levels"),
@@ -71,25 +72,8 @@ def _form_spec_oposs_wiseways_ups_battery():
7172
prefill_fixed_levels=DefaultValue((10.0, 5.0)),
7273
),
7374
),
74-
},
75-
)
76-
77-
78-
rule_spec_oposs_wiseways_ups_battery = CheckParameters(
79-
title=Title("OPOSS Wiseways UPS Battery"),
80-
topic=Topic.POWER,
81-
name="oposs_wiseways_ups_battery",
82-
parameter_form=_form_spec_oposs_wiseways_ups_battery,
83-
condition=HostAndServiceCondition(),
84-
)
85-
86-
87-
# Power (voltages) monitoring ruleset
88-
def _form_spec_oposs_wiseways_ups_power():
89-
return Dictionary(
90-
title=Title("OPOSS Wiseways UPS Power Monitoring"),
91-
help_text=Help("Configure voltage thresholds for UPS power monitoring"),
92-
elements={
75+
76+
# Power/Voltage parameters
9377
"input_voltage_upper": DictElement(
9478
parameter_form=SimpleLevels(
9579
title=Title("Input voltage upper levels"),
@@ -138,25 +122,8 @@ def _form_spec_oposs_wiseways_ups_power():
138122
prefill_fixed_levels=DefaultValue((210.0, 200.0)),
139123
),
140124
),
141-
},
142-
)
143-
144-
145-
rule_spec_oposs_wiseways_ups_power = CheckParameters(
146-
title=Title("OPOSS Wiseways UPS Power"),
147-
topic=Topic.POWER,
148-
name="oposs_wiseways_ups_power",
149-
parameter_form=_form_spec_oposs_wiseways_ups_power,
150-
condition=HostAndServiceCondition(),
151-
)
152-
153-
154-
# Load monitoring ruleset
155-
def _form_spec_oposs_wiseways_ups_load():
156-
return Dictionary(
157-
title=Title("OPOSS Wiseways UPS Load Monitoring"),
158-
help_text=Help("Configure thresholds for UPS load monitoring"),
159-
elements={
125+
126+
# Load parameters
160127
"load_upper": DictElement(
161128
parameter_form=SimpleLevels(
162129
title=Title("Output load levels"),
@@ -170,25 +137,8 @@ def _form_spec_oposs_wiseways_ups_load():
170137
),
171138
required=True,
172139
),
173-
},
174-
)
175-
176-
177-
rule_spec_oposs_wiseways_ups_load = CheckParameters(
178-
title=Title("OPOSS Wiseways UPS Load"),
179-
topic=Topic.POWER,
180-
name="oposs_wiseways_ups_load",
181-
parameter_form=_form_spec_oposs_wiseways_ups_load,
182-
condition=HostAndServiceCondition(),
183-
)
184-
185-
186-
# Frequency monitoring ruleset
187-
def _form_spec_oposs_wiseways_ups_frequency():
188-
return Dictionary(
189-
title=Title("OPOSS Wiseways UPS Frequency Monitoring"),
190-
help_text=Help("Configure frequency thresholds for UPS monitoring"),
191-
elements={
140+
141+
# Frequency parameters
192142
"frequency_upper": DictElement(
193143
parameter_form=SimpleLevels(
194144
title=Title("Frequency upper levels"),
@@ -219,10 +169,10 @@ def _form_spec_oposs_wiseways_ups_frequency():
219169
)
220170

221171

222-
rule_spec_oposs_wiseways_ups_frequency = CheckParameters(
223-
title=Title("OPOSS Wiseways UPS Frequency"),
172+
rule_spec_oposs_wiseways_ups = CheckParameters(
173+
title=Title("OPOSS Wiseways UPS"),
224174
topic=Topic.POWER,
225-
name="oposs_wiseways_ups_frequency",
226-
parameter_form=_form_spec_oposs_wiseways_ups_frequency,
175+
name="oposs_wiseways_ups",
176+
parameter_form=_form_spec_oposs_wiseways_ups,
227177
condition=HostAndServiceCondition(),
228178
)

0 commit comments

Comments
 (0)