Checkmk Server:
Checkmk version: 2.2.0b4_0 raw
OS: Ubuntu 20.04.6 LTS
Package: check-mk-raw-2.2.0b4_0.focal_amd64.deb
Monitored System (Host):
Checkmk Agent version: 2.2.0b4-1
OS: Ubuntu 20.04.5 LTS monitored system (Host)
Package: check-mk-agent_2.2.0b4-1_all.deb
The monitored system is in a local network and have a local IP address only: 192.168.1.110
On the border router/firewall a NAT Forward has been configured so that incoming connection on a public IP are forwarded to the Monitored System.
This way the Monitored System …“serves” http/https, ssh, etc requests.
The Firewall is open for port 6556
The Agent on the Monitored system has been succesfully installed and registered:
sudo cmk-agent-ctl status
Version: 2.2.0b4
Agent socket: operational
IP allowlist: any
Connection: xx.xx.xxx.x/xxx_xxxxxxx
UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Local:
Connection mode: pull-agent
Connecting to receiver port: 8000
Certificate issuer: Site 'aaa_bbbbbbb' agent signing CA
Certificate validity: Fri, 28 Apr 2023 16:06:26 +0000 - Fri, 28 Apr 2028 16:06:26 +0000
Remote:
Connection mode: pull-agent
Hostname: xxxxxxx.xxxxxxxxx.xx
Description of the problem :
The socket of the monitored system work as expected when the connection ‘point’ to the local IP configured:
Telnet connection from a shell on the monitored system itself:
telnet 192.168.1.110 6556
Trying 192.168.1.110...
Connected to 192.168.1.110.
Escape character is '^]'.
16
BUT, if i try to connect to port 6556 from the outside via the PUBLIC IP (forwarded via NAT by the Router/Firewall) i got a “Connection refused”.
Notably, the same thing (Connection refused) happens even if i try to connect from a shell on the monitored server itself !!!
telnet PUBLIC_NATTED_IP 6556
Trying XXX.XX.XXX.XXX...
telnet: Unable to connect to remote host: Connection refused
The socket looks ok to me:
sudo ss -tlpn | grep 6556
LISTEN 0 4096 *:6556 *:* users:(("cmk-agent-ctl",pid=78735,fd=9))
and not using xinetd but systemd.
To debug the situation i tried to look at the log produced by the Agent Controller:
journalctl -fb -u cmk-agent-ctl-daemon.service
-- Logs begin at Fri 2023-02-10 08:39:12 CET. --
Apr 28 19:18:25 dev systemd[1]: Started Checkmk agent controller daemon.
Apr 29 12:45:15 dev cmk-agent-ctl[78735]: WARN [cmk_agent_ctl::modes::pull] [::ffff:127.0.0.1]:60636: Request failed. (received corrupt message)
Apr 29 12:46:59 dev cmk-agent-ctl[78735]: WARN [cmk_agent_ctl::modes::pull] [::ffff:127.0.0.1]:53128: Request failed. (received corrupt message)
Apr 29 15:03:57 dev cmk-agent-ctl[78735]: WARN [cmk_agent_ctl::modes::pull] [::ffff:192.168.1.111]:43988: Request failed. (received corrupt message)
Apr 29 15:21:09 dev cmk-agent-ctl[78735]: WARN [cmk_agent_ctl::modes::pull] [::ffff:192.168.1.111]:40832: Request failed. (received corrupt message)
Apr 29 17:00:12 dev cmk-agent-ctl[78735]: WARN [cmk_agent_ctl::modes::pull] [::ffff:192.168.1.110]:54602: Request failed. (received corrupt message)
but i only see the succesfull telnet connections to the Local IP.
- Is there a way to activate/see more detailed LOGs from the Agent Controller or other logs that can have useful informations?
- Any idea of what is causing the problem ?
- Is there a way to configure the Monitored System to PUSH data to the CheckMK Server ? (the comunication in this dorection works, being i was able to register the Agent)
Maybe the problem is related to the PUBLIC IP that is forwardes via NAT.
But the NAT forward is currently working correctly for the WEB Server (80,443) and for the SSH servr (22) so i guess this would be ok for the Agent Controller as well…
Thanks in advance
l.