CMK: 2.1.0p16 cre
OS version: Raspbian GNU/Linux 11 (bullseye)
Error: Broken UI extensions
CRIT: Loading “/omd/sites/test/local/share/check_mk/web/plugins/wato/exists.py” failed: cannot import name ‘CheckParameterRuleSpecWithItem’ from ‘cmk.gui.plugins.wato’ (unknown location) (!!)
I dont understand why i get this Error. I did it like in the docs for creating plugins.
File:
#!/usr/bin/python
from cmk.gui.i18n import _
from cmk.gui.valuespec import (
Dictionary,
Integer,
TextAscii,
DropdownChoice
)
from cmk.gui.plugins.wato import (
CheckParameterRuleSpecWithItem,
rulespec_registry,
RulespecGroupCheckParametersOperatingSystem,
)
def _item_valuespec_exists():
return TextAscii(title=_("absolute Path"))
def _parameter_valuespec_exists():
return Dictionary(
elements=[
("shouldCrit", DropDownChoice(
title = _("Throw critical if not found otherwise it throws warning"),
help = _("default is Yes"),
choices = [
(False, _("No")),
(True, _("Yes")),
],
default_value= "yes"
)),
]
)
rulespec_registry.register(
CheckParameterRulespecWithItem(
check_group_name="exists",
group=RulespecGroupParametersOperatingSystem,
item_spec=_item_valuespec_exists,
match_type="dict",
parameter_valuespec=_parameter_valuespec_exists,
title=lambda: _("Parameter for checking if Files/Folder exists")
)
)