On systemd systems the dataflow is as follows:
- The systemd service cmk-agent-ctl-daemon.service listens on TCP port 6556 (by default).
- If that daemon decides to call the checkmk agent, it talks into the local unix domain socket /run/check-mk-agent.socket.
- That socket is controlled by the systemd socket unit check-mk-agent.socket.
- If something “happens” on that socket, systemd starts the service unit check-mk-agent@.service which then in turn runs the agent.
To change the listening port from 6556 to 16556 you must create (or edit) the file /var/lib/cmk-agent/cmk-agent-ctl.toml
on the monitored host and add this line:
pull_port = 16556
After that, do a systemctl restart cmk-agent-ctl-daemon.service
.
Unfortuntely, this is not documented very well.
Usually the file /var/lib/cmk-agent/cmk-agent-ctl.toml is maintained by the agent bakery.