2023-08-20 18:01:52 +02:00
|
|
|
from cmk.gui.i18n import _
|
2024-01-21 14:03:55 +01:00
|
|
|
|
|
|
|
from cmk.gui.plugins.wato.special_agents.common import (
|
|
|
|
RulespecGroupDatasourceProgramsApps,
|
|
|
|
RulespecGroupDatasourceProgramsCustom,
|
|
|
|
RulespecGroupDatasourceProgramsHardware,
|
|
|
|
RulespecGroupDatasourceProgramsOS,
|
|
|
|
RulespecGroupDatasourceProgramsTesting,
|
2023-08-20 18:01:52 +02:00
|
|
|
)
|
|
|
|
|
2024-01-26 11:39:01 +01:00
|
|
|
from cmk.gui.plugins.wato.utils import (
|
|
|
|
IndividualOrStoredPassword,
|
|
|
|
rulespec_registry,
|
|
|
|
CheckParameterRulespecWithItem,
|
|
|
|
CheckParameterRulespecWithoutItem,
|
|
|
|
HostRulespec,
|
|
|
|
Rulespec,
|
|
|
|
)
|
|
|
|
|
2023-08-20 18:01:52 +02:00
|
|
|
from cmk.gui.valuespec import (
|
|
|
|
Dictionary,
|
|
|
|
ListChoice,
|
|
|
|
Checkbox,
|
|
|
|
TextAscii,
|
|
|
|
Password,
|
2024-01-26 11:39:01 +01:00
|
|
|
NetworkPort,
|
|
|
|
Integer,
|
2023-08-20 18:01:52 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
def _valuespec_special_agent_mailcow():
|
|
|
|
return Dictionary(
|
|
|
|
title=_("Mailcow Server Information"),
|
|
|
|
help = _("Checking Mailcow instances via API"),
|
|
|
|
elements=[
|
|
|
|
("hostname", TextAscii(title=_("Hostname"),
|
2024-01-26 11:39:01 +01:00
|
|
|
size=32,
|
2023-08-20 18:01:52 +02:00
|
|
|
allow_empty=False,
|
|
|
|
help=_("Hostname of Mailcow server (bare FQDN or IP), mandatory"))),
|
2024-01-26 11:39:01 +01:00
|
|
|
("apikey", IndividualOrStoredPassword(title=_("API Key"),
|
|
|
|
size=32,
|
2023-08-20 18:01:52 +02:00
|
|
|
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(
|
2024-01-21 14:03:55 +01:00
|
|
|
group=RulespecGroupDatasourceProgramsApps,
|
2023-08-20 18:01:52 +02:00
|
|
|
name="special_agents:mailcow",
|
|
|
|
valuespec=_valuespec_special_agent_mailcow,
|
|
|
|
)
|
|
|
|
)
|