special_agent.py 563 B

1234567891011121314151617181920212223242526272829303132
  1. #!/usr/bin/env python3
  2. from collections.abc import Iterable
  3. from cmk.server_side_calls.v1 import (
  4. HostConfig,
  5. SpecialAgentCommand,
  6. SpecialAgentConfig,
  7. noop_parser,
  8. )
  9. def _agent_arguments(
  10. params,
  11. host_config: HostConfig,
  12. ) -> Iterable[SpecialAgentCommand]:
  13. address = host_config.address
  14. if not address:
  15. return
  16. yield SpecialAgentCommand(
  17. command_arguments=[address],
  18. )
  19. special_agent_p1 = SpecialAgentConfig(
  20. name="p1",
  21. parameter_parser=noop_parser,
  22. commands_function=_agent_arguments,
  23. )