Issues with registering agent - Linux - No qualified domain name

I want to install the agent on Ubuntu server running as VM in proxmox
It is on IP 192.168.1.28

My CheckMK is running
It is on 192.168.1.15
Ubuntu server @ 22.04.4
CheckMK RAW 2.2.0p24

I am running in a home lab and do not have full qualified domain names for anything

The command I am running the machine I want the agent on is

sudo cmk-agent-ctl -v register --server 192.168.1.15 --site services --user --hostname 192.168.1.28

INFO [cmk_agent_ctl] starting
INFO [cmk_agent_ctl] Loaded config from '"/var/lib/cmk-agent/cmk-agent-ctl.toml"', connection registry from '"/var/lib/cmk-agent/registered_connections.json"'
INFO [cmk_agent_ctl::site_spec] Failed to discover agent receiver port using https.
INFO [cmk_agent_ctl::site_spec] Failed to discover agent receiver port using http.
ERROR [cmk_agent_ctl] Failed to discover agent receiver port from Checkmk REST API, both with http and https. Run with verbose output to see errors.

Can anybody help me because I lost a day trying to make this work

Try it with --server 192.168.1.15:8000.

so that triggered a lot more to happen but I still get an error

russell@plex-ubuntu:~$ sudo cmk-agent-ctl -v register --server 192.168.1.15:8000 --site monitoring --user<user> --hostname 192.168.1.28
INFO [cmk_agent_ctl] starting
INFO [cmk_agent_ctl] Loaded config from '"/var/lib/cmk-agent/cmk-agent-ctl.toml"', connection registry from '"/var/lib/cmk-agent/registered_connections.json"'
Attempting to register at 192.168.1.15, port 8000. Server certificate details:

PEM-encoded certificate:
-----BEGIN CERTIFICATE-----
xxxxxxxxxxxxxxxx
-----END CERTIFICATE-----

Issued by:
        Site 'monitoring' local CA
Issued to:
        monitoring
Validity:
        From Sun, 07 Apr 2024 07:12:04 +0000
        To   Mon, 07 Apr 3023 07:12:04 +0000

Do you want to establish this connection? [Y/n]
> y

Please enter password for 'userl'
>
ERROR [cmk_agent_ctl] Error registering existing host at https://192.168.1.15:8000/monitoring

Caused by:
    Request failed with code 404 Not Found: Host 192.168.1.28 does not exist.

I can get to the checkmk UI @
http://192.168.1.15/monitoring/

192.168.1.15 (CheckMK) can ping 192.168.1.15 (Where the agent is)

I am so close now and just cannot figure out what the issue is…

I would use hostnames and not ip adresses as hostname in checkmk.
you can additionally set an ip address if the name is not resolvable.

2 Likes

So this has got things working.

It is a home lab and I do not want the certs timing out…is there a parameter I can add to make the cert unlimited in duration or at least longer than 1 year.

I know this is not great security but this is all on a local network

1 Like

Did you try with hostname? Exactly as it is in Checkmk (caps and lowercase).
You can see in “Available agent configurations”, if the host is on the agent scope.

Hi, the CA for the TLS Registration is valid for a thousand years and the agent certificates are automatically renewed, so you don´t have anything to do there.

2 Likes

I am blown away with the support you folks give…this has really helped me.
(Especially as this is home lab)

Here is the command that I ran to get it to work

sudo cmk-agent-ctl -v register --server 192.168.1.15:8000 --site monitoring --user russell --hostname (My Host Name>

So I think the answer to your question is… YES
(I can only get the server to work when specified with IP:PORT but think that makes sense as I do not have a FQDN)

1 Like

Marking this as closed based on all the awesome support.
(Will cross my fingers that that cert updates happen :slight_smile: )