| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- #!/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 voltage thresholds"),
- help_text=Help(
- "Upper voltage thresholds. "
- "The first value is WARNING and the second is CRITICAL."
- ),
- elements={
- "levels": DictElement(
- required=True,
- parameter_form=SimpleLevels(
- title=Title("Voltage thresholds"),
- form_spec_template=Float(
- unit_symbol="V",
- ),
- level_direction=LevelDirection.UPPER,
- prefill_fixed_levels=DefaultValue(
- value=(252.0, 253.0)
- ),
- ),
- ),
- },
- )
- rule_spec_p1_voltage = CheckParameters(
- name="p1_voltage",
- title=Title("P1 voltage"),
- topic=Topic.POWER,
- parameter_form=_parameter_form,
- condition=HostAndItemCondition(
- item_title=Title("Phase"),
- ),
- )
|