Mailcow-CheckMK/local/share/check_mk/web/plugins/wato/mailcow_params.py

57 lines
1.8 KiB
Python

from cmk.gui.i18n import _
from cmk.gui.plugins.wato import (
CheckParameterRulespecWithItem,
rulespec_registry,
)
from cmk.gui.plugins.wato.special_agents.common import (
RulespecGroupDatasourceProgramsApps,
RulespecGroupDatasourceProgramsCustom,
RulespecGroupDatasourceProgramsHardware,
RulespecGroupDatasourceProgramsOS,
RulespecGroupDatasourceProgramsTesting,
)
from cmk.gui.valuespec import (
Dictionary,
ListChoice,
Checkbox,
TextAscii,
Password,
)
from cmk.gui.plugins.wato import (
HostRulespec,
)
from cmk.gui.plugins.wato.datasource_programs import RulespecGroupDatasourceProgramsCustom
def _valuespec_special_agent_mailcow():
return Dictionary(
title=_("Mailcow Server Information"),
help = _("Checking Mailcow instances via API"),
elements=[
("hostname", TextAscii(title=_("Hostname"),
allow_empty=False,
help=_("Hostname of Mailcow server (bare FQDN or IP), mandatory"))),
("apikey", TextAscii(title=_("API Key"),
allow_empty=False,
help=_("API Key, mandatory"))),
("port", TextAscii(title=_("Port"),
allow_empty=True,
help=_("Specify port if not listening to HTTPS/HTTP, optional"))),
("no_https", Checkbox(title=_("Disable HTTPS"),
help=_("Activate to disable TLS encryption (not recommended), optional"))),
("no_cert_check", Checkbox(title=_("Disable certificate validation"),
help=_("Activate to disable certificate validation (not recommended), optional"))),
],
optional_keys=[],
)
rulespec_registry.register(
HostRulespec(
group=RulespecGroupDatasourceProgramsApps,
name="special_agents:mailcow",
valuespec=_valuespec_special_agent_mailcow,
)
)