|
@@ -2,6 +2,8 @@
|
|
|
|
|
|
# -*- encoding: utf-8; py-indent-offset: 4 -*-
|
|
# -*- encoding: utf-8; py-indent-offset: 4 -*-
|
|
|
|
|
|
|
|
+# (c) Michael Honkoop <mhonkoop@comsolve.nl>
|
|
|
|
+
|
|
# License: GNU General Public License v2
|
|
# License: GNU General Public License v2
|
|
|
|
|
|
from collections.abc import Iterator, Mapping, Sequence
|
|
from collections.abc import Iterator, Mapping, Sequence
|
|
@@ -12,15 +14,20 @@ from cmk.server_side_calls.v1 import HostConfig, SpecialAgentCommand, SpecialAge
|
|
from cmk.server_side_calls.v1._utils import Secret
|
|
from cmk.server_side_calls.v1._utils import Secret
|
|
|
|
|
|
class Params(BaseModel):
|
|
class Params(BaseModel):
|
|
|
|
+ check_tls: bool | None = None
|
|
user: str
|
|
user: str
|
|
password: Secret
|
|
password: Secret
|
|
|
|
|
|
def commands_function(params: Params, host_config: HostConfig) -> Iterator[SpecialAgentCommand]:
|
|
def commands_function(params: Params, host_config: HostConfig) -> Iterator[SpecialAgentCommand]:
|
|
- command_arguments: Sequence[str | Secret] = [
|
|
|
|
|
|
+ """Always use LDAPS for querying LDAP Server"""
|
|
|
|
+ command_arguments: list[str | Secret] = [
|
|
"ldaps://" + host_config.name + ":636",
|
|
"ldaps://" + host_config.name + ":636",
|
|
params.user,
|
|
params.user,
|
|
params.password.unsafe(),
|
|
params.password.unsafe(),
|
|
]
|
|
]
|
|
|
|
+ if params.check_tls is not None and params.check_tls is True:
|
|
|
|
+ command_arguments += ["--verify_tls"]
|
|
|
|
+
|
|
yield SpecialAgentCommand(command_arguments=command_arguments)
|
|
yield SpecialAgentCommand(command_arguments=command_arguments)
|
|
|
|
|
|
special_agent_edirectory_monitor = SpecialAgentConfig(
|
|
special_agent_edirectory_monitor = SpecialAgentConfig(
|
|
@@ -28,4 +35,3 @@ special_agent_edirectory_monitor = SpecialAgentConfig(
|
|
parameter_parser=Params.model_validate,
|
|
parameter_parser=Params.model_validate,
|
|
commands_function=commands_function,
|
|
commands_function=commands_function,
|
|
)
|
|
)
|
|
-
|
|
|