Error Registering Windows Agent: You need to be authenticated to use the REST API

CMK version: 2.1.0p3
OS version: Ubuntu 20.04.04

Error message:

[2022-06-23 13:14:17.442520 -04:00] ERROR [cmk_agent_ctl] src\main.rs:29: Error pairing with xx.xx.xx.xx:8000/monitoring                                                                                                                                                                                                                                                                                                            Caused by:                                                                                                                                                                                                            Request failed with code 401 Unauthorized: You need to be authenticated to use the REST API. 

Following the instructions here, I am attempting to register Windows agent with the following command:

"C:\Program Files (x86)\checkmk\service\cmk-agent-ctl.exe" register --hostname xx --server xx --site monitoring --user automation --password xx

I get past accepting the certificate and immediately receive that error. Windows 11 21H2.

I haven’t tried it with the agent registration for tls but at least the bakery registration needed a normal user with a password and not an automation user with a secret.

Yesterday (the doc is built at 23:15 UTC+2) we added this section for trouble shooting. Just skip this call to the REST API By providing the port directly: