| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- #!/usr/bin/env python3
- from cmk.rulesets.v1 import Help, Title
- from cmk.rulesets.v1.form_specs import (
- DefaultValue,
- DictElement,
- Dictionary,
- Float,
- LevelDirection,
- SimpleLevels,
- )
- from cmk.rulesets.v1.rule_specs import (
- CheckParameters,
- HostAndItemCondition,
- Topic,
- )
- def _parameter_form():
- return Dictionary(
- title=Title("P1 current thresholds"),
- help_text=Help(
- "Upper current thresholds for the P1 meter."
- ),
- elements={
- "levels": DictElement(
- required=True,
- parameter_form=SimpleLevels(
- title=Title("Current thresholds"),
- form_spec_template=Float(
- unit_symbol="A",
- ),
- level_direction=LevelDirection.UPPER,
- prefill_fixed_levels=DefaultValue(
- value=(8.0, 10.0),
- ),
- ),
- ),
- },
- )
- rule_spec_p1_current = CheckParameters(
- name="p1_current",
- title=Title("P1 current"),
- topic=Topic.POWER,
- parameter_form=_parameter_form,
- condition=HostAndItemCondition(
- item_title=Title("Current channel"),
- ),
- )
|