Przeglądaj źródła

Initial commit of plugins\p1-meter\server_side_calls\special_agent.py

Michael Honkoop 1 dzień temu
rodzic
commit
25830a5138
1 zmienionych plików z 32 dodań i 0 usunięć
  1. 32 0
      plugins/p1-meter/server_side_calls/special_agent.py

+ 32 - 0
plugins/p1-meter/server_side_calls/special_agent.py

@@ -0,0 +1,32 @@
+#!/usr/bin/env python3
+
+from collections.abc import Iterable
+
+from cmk.server_side_calls.v1 import (
+    HostConfig,
+    SpecialAgentCommand,
+    SpecialAgentConfig,
+    noop_parser,
+)
+
+
+def _agent_arguments(
+    params,
+    host_config: HostConfig,
+) -> Iterable[SpecialAgentCommand]:
+
+    address = host_config.address
+
+    if not address:
+        return
+
+    yield SpecialAgentCommand(
+        command_arguments=[address],
+    )
+
+
+special_agent_p1 = SpecialAgentConfig(
+    name="p1",
+    parameter_parser=noop_parser,
+    commands_function=_agent_arguments,
+)