瀏覽代碼

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

Michael Honkoop 1 天之前
父節點
當前提交
25830a5138
共有 1 個文件被更改,包括 32 次插入0 次删除
  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,
+)