How to change default port for checkmk linux agent 2.1 version

You are welcome. Maybe this picture helps a bit understanding the data flow. It’s from the checkmk conference 2022 and shows the “new” communication.

To change the listening port we have to change the configuration of the “transport channel” on the left hand side of the slide, i.e. the configuration of the cmk-agent-ctl daemon. By default it listens on port 6556 and allows access from every IP address.

This can be changed with the file /var/lib/cmk-agent/cmk-agent-ctl.toml (in Python syntax):

pull_port = 16556
allowed_ip = [
    "127.0.0.1", 
    "127.0.0.2",
]

(The file doesn’t exist by default.)

2 Likes