Unable to register agent (Error Code 500 - Internal Server Error)

CMK version: 2.2.0b6.cre
OS version: Debian 11 (Server), Windows Server 2019 (Host)

Error message:

[2023-06-11 17:01:03.664255 +02:00] ERROR [cmk_agent_ctl] src\main.rs:29: Error registering exisiting host at https://10.200.200.5:8001/Hegmanns_AG

Caused by:
    Request failed with code 500 Internal Server Error: Internal Server Error

Description:
Hello Guys!

As the title says, I’m all of a sudden unable to register agents with my CheckMK-Server. If I try to register a new host, I get to the stage where I can confirm the certificate and then the registration fails, citing an internal server error with error code 500.

I strongly suspect SSL for being the root for this error, as this issue started occuring since I activated https.

Used Command:
& 'C:\Program Files (x86)\checkmk\service\cmk-agent-ctl.exe' -vv register --hostname test-wins-hgh-0.hegmanns.test --server 10.200.200.5 --site Hegmanns_AG --user registration --password XXX

Output from cmk-agent-ctl.exe

[2023-06-11 17:00:59.700480 +02:00] INFO [cmk_agent_ctl] src\main.rs:14: starting
[2023-06-11 17:00:59.702972 +02:00] INFO [cmk_agent_ctl] src\lib.rs:50: Loaded config from '"C:\\ProgramData\\checkmk\\agent\\cmk-agent-ctl.toml"', connection registry from '"C:\\ProgramData\\checkmk\\agent\\registered_connections.json"'
[2023-06-11 17:00:59.707109 +02:00] DEBUG [reqwest::connect] C:\Users\sk\.cargo\registry\src\github.com-1ecc6299db9ec823\reqwest-0.11.13\src\connect.rs:429: starting new connection: https://10.200.200.5/
Attempting to register at 10.200.200.5, port 8001. Server certificate details:

PEM-encoded certificate:
-----BEGIN CERTIFICATE-----
[...]
-----END CERTIFICATE-----

Issued by:
        Site 'Hegmanns_AG' local CA
Issued to:
        Hegmanns_AG
Validity:
        From Fri, 12 May 2023 12:11:56 +0000
        To   Sun, 12 May 3022 12:11:56 +0000

Do you want to establish this connection? [Y/n]
> Y
[2023-06-11 17:01:03.612401 +02:00] DEBUG [reqwest::connect] C:\Users\sk\.cargo\registry\src\github.com-1ecc6299db9ec823\reqwest-0.11.13\src\connect.rs:429: starting new connection: https://10.200.200.5:8001/
[2023-06-11 17:01:03.664255 +02:00] ERROR [cmk_agent_ctl] src\main.rs:29: Error registering exisiting host at https://10.200.200.5:8001/Hegmanns_AG

Caused by:
    Request failed with code 500 Internal Server Error: Internal Server Error

What I already tried:

  • Using a different Server
  • Using FQDN instead of IP
  • Reinstalling the Host-Agent
  • Restarting Host as well as Server
  • Tried using trust cert option
  • Checked hostname for typos

Any Ideas on how to fix this?

Thanks in advance,
Pierre

Hi @P.Stannies

It seems that the host you are trying to register is already registered at the Checkmk site.

Can you verify this? You can use the following command for this,

"C:\Program Files (x86)\checkmk\service\cmk-agent-ctl.exe" status

It also seems that you have multiple sites on your Checkmk server based on port 8001 in the response. Please make sure this is also the right port for your Checkmk site.

Login change to your site user context and execute the following command:

OMD[mysite]:~$ omd config show | grep AGENT_RECEIVER

Hope this helps.

Regards
Norm

Check the logs /omd/sites/SITE/var/log/agent-receiver

My problem was:
FileNotFoundError: [Errno 2] No such file or directory: ‘/omd/sites/SITE/var/check_mk/web/automation/automation.secret’

From GUI Setup->User create secret for user automation (usually default is configured)
I have configured password for user automation because I did not knew what password to use.

For registering a host use user automation and as password the content of /omd/sites/SITE/var/check_mk/web/automation/automation.secret

It did not work with other users

2 Likes

Im justed deleted the automation User.

Fixed that with create a new User “automation” and created the file automation.secret with the password as String. worked fine for me.

Thx karni

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.