Host registration error - ERROR [cmk_agent_ctl] Host is unreachable (os error 113)

Hi, thanks in the meantime, I have a host registration error in checkmk, of a Rocky 9 Linux server.
The checkmk server is 192.168.1.112
the Linux Rocky 9 server is 192.168.1.113
I write the command on the Rocky 9 Linux server:

cmk-agent-ctl register --hostname 192.168.1.113 --server 192.168.1.112 --site Dado --user cmkadmin

and I get this:

Attempting to register at 192.168.1.112, port 8000. Server certificate details:

ERROR [cmk_agent_ctl] Host is unreachable (os error 113)

This is my first installation and I carefully followed the online manual.

Thank you

It sounds likely that port 8000 from the Rocky9 server to the CheckMK server is blocked. Please see this document for all ports that need to be allowed both on the CheckMK server and the monitored hosts

Thanks for the reply, could totally disabling the firewall in Rocky Linux 9 on only the client to be monitored be the solution to quickly understand if it is a port problem? should it be disabled only on the client to be monitored or also on the check MK server? which is also always a Rocky Linux 9?

You can try to telnet to port 8000 (you might need to install telnet)
if you get a reply then the port is available/accessible.

telnet your.monitoring.server 8000
  • Glowsome

I ran Telnet (I installed it first) this is the response:
telnet 192.168.1.112 8000
Trying 192.168.1.112…
telnet: connect to address 192.168.1.112: No route to host

I add as information to understand my level, that I am the first experience with Linux

Next step would be to check a/the firewall on the Monitoring server.

I will assume - if it is there it will be firewalld - check if its there/running

firewall-cmd --state 

if it is active/running please read up on how to configure a/the firewall in This article

  • Glowsome

he replies, Running
what should I configure in the firewall?

Add port 8000 to the config of the firewall (assuming the zone is public)

firewall-cmd --zone=public --add-port=8000/tcp

Then test if the port is reachable again via Telnet.

  • Glowsome

Meanwhile, I wanted to thank you for your help, I added port on the FW and now from .113 to .112 I get this:

telnet 192.168.1.112 8000

Trying 192.168.1.112…
Connected to 192.168.1.112.
Escape character is ‘^]’.

Shall I now try to register the agent by launching the command on the .113 with this command?
cmk-agent-ctl register --hostname 192.168.1.113 --server 192.168.1.112:8000 --site Dado --user cmkadmin

With the above response you should now be able to register your agent.

  • Glowsome

error in the command I wrote above, it was wrong to write 192.168.1.113 I had to write the host name created in cmk so corrected the above command in:
cmk-agent-ctl register --hostname DA113 --server 192.168.1.112:8000 --site Dado --user cmkadmin
and registered

Also do not forget to make your changes to the firewall permanent with:

firewall-cmd --runtime-to-permanent

Else after a reboot the changes you just made will be gone.

  • Glowsome

however in cmk if in the host 113 tab I click on the “save and run connection test” button I get this error on the agent:
Communication failed: [Errno 113] No route to host

Have you performed opening the port on both client and server ?

  • Glowsome

only on the server, should I also do it on the client?

Yes, on both client and server this port needs to be open to communicate.

  • Glowsome

on DA113 I added the 8000 tcp port
here is the result:
[root@DA113 ~]# firewall-cmd --zone=public --list-all
public (active)
target: default
icmp-block-inversion: no
interfaces: ens33
sources:
services: cockpit dhcpv6-client ssh
ports: 8000/tcp
protocols:
forward: yes
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:

but if I try to Telnet from DA112 to DA113 I get:
[root@DA112 ~]# telnet 192.168.1.113 8000
Trying 192.168.1.113…
telnet: connect to address 192.168.1.113: Connection refused

how is this possible?

my bad, on the monitored host the port should not be 8000/tcp , but 6556/tcp ( see documentation regarding used ports already lined in this thread).

  • Glowsome
1 Like

Perfect, all these problems resolved, now I see host da113 in cmk, very kind, you are the king :wink:
Now I’ll study the rest of the environment configuration, in the meantime this step is done… thanks again!

1 Like

Would you be so kind as to mark this topic as ‘solved’ ?

  • Glowsome
1 Like