initial upload of version 2.1.0 which uses the new plugin API
This commit is contained in:
65
mailcow/rulesets/rs_mailcow_info.py
Normal file
65
mailcow/rulesets/rs_mailcow_info.py
Normal file
@@ -0,0 +1,65 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
defines the form for typing in all needed levels
|
||||
regarding number of domains, mailboxes and global message count
|
||||
"""
|
||||
|
||||
from cmk.rulesets.v1 import Help, Title
|
||||
from cmk.rulesets.v1.form_specs import (
|
||||
DictElement,
|
||||
Dictionary,
|
||||
SimpleLevels,
|
||||
LevelDirection,
|
||||
DefaultValue,
|
||||
Integer,
|
||||
)
|
||||
from cmk.rulesets.v1.rule_specs import (
|
||||
CheckParameters,
|
||||
Topic,
|
||||
HostCondition,
|
||||
)
|
||||
|
||||
|
||||
def _parameter_form() -> Dictionary:
|
||||
return Dictionary(
|
||||
title=Title("Levels for global Mailcow information"),
|
||||
help_text=Help("Checking Mailcow systems via API"),
|
||||
elements={
|
||||
"levels_num_domains": DictElement(
|
||||
parameter_form=SimpleLevels(
|
||||
title=Title("Levels for number of email domains"),
|
||||
form_spec_template=Integer(),
|
||||
level_direction=LevelDirection.UPPER,
|
||||
prefill_fixed_levels=DefaultValue(value=(100, 200)),
|
||||
),
|
||||
required=True,
|
||||
),
|
||||
"levels_num_mailboxes": DictElement(
|
||||
parameter_form=SimpleLevels(
|
||||
title=Title("Levels for number of mailboxes"),
|
||||
form_spec_template=Integer(),
|
||||
level_direction=LevelDirection.UPPER,
|
||||
prefill_fixed_levels=DefaultValue(value=(500, 1000)),
|
||||
),
|
||||
required=True,
|
||||
),
|
||||
"levels_num_global_messages": DictElement(
|
||||
parameter_form=SimpleLevels(
|
||||
title=Title("Levels for number of messages"),
|
||||
form_spec_template=Integer(),
|
||||
level_direction=LevelDirection.UPPER,
|
||||
prefill_fixed_levels=DefaultValue(value=(100_000, 250_000)),
|
||||
),
|
||||
required=True,
|
||||
),
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
rule_spec_mailcow_info = CheckParameters(
|
||||
name="mailcow_info",
|
||||
title=Title("Mailcow global levels"),
|
||||
topic=Topic.APPLICATIONS,
|
||||
parameter_form=_parameter_form,
|
||||
condition=HostCondition(),
|
||||
)
|
||||
Reference in New Issue
Block a user