HAL9001-CheckMK/local/share/check_mk/web/plugins/wato/hal9001_storages_rules.py

52 lines
1.5 KiB
Python

from cmk.gui.i18n import _
from cmk.gui.plugins.wato import (
CheckParameterRulespecWithItem,
rulespec_registry,
RulespecGroupCheckParametersApplications
)
from cmk.gui.valuespec import (
Dictionary,
ListChoice,
TextAscii,
Percentage,
Tuple,
Float,
Integer
)
def _item_spec_hal9001_storages():
return TextAscii(
title=_("HAL Storage ID")
)
def _parameter_spec_hal9001_storages():
return Dictionary(
elements=[
("levels_hal_storages_rates", Tuple(
title=_("hal9001 levels for storage up and download rate"),
elements=[
Float(
title=_("Warning above"),
default_value=200.0,
unit="MBytes/s",
),
Float(
title=_("Critical above"),
default_value=300.0,
unit="MBytes/s",
)
],
)),
],
)
rulespec_registry.register(
CheckParameterRulespecWithItem(
check_group_name="hal9001_storages_storage_rates",
group=RulespecGroupCheckParametersApplications,
match_type="dict",
item_spec=_item_spec_hal9001_storages,
parameter_valuespec=_parameter_spec_hal9001_storages,
title=lambda: _("Levels for HAL9001 storage upload/download"),
)
)