CMK-Agent-Ctl.exe/TLS error

2.1.0p13.cee
Ubuntu 16.04.7 LTS

Attempting to register windows host with TLS upon performing corresponding command

cmk-agent-ctl.exe register --hostname xxx --server checkmk:8000 --site monitoring --user automation --password xxx

Receive the following error. If anyone has any ideas to resolving please let me know. :slight_smile:

[2022-11-15 12:06:06.273021 -05:00] ERROR [cmk_agent_ctl] src\main.rs:29: Error
pairing with checkmk.mnp.ca:8000/monitoring

Caused by:
0: error sending request for url (https://checkmk8000/monitoring/age
nt-receiver/pairing): error trying to connect: The message received was unexpect
ed or badly formatted. (os error -2146893018)
1: error trying to connect: The message received was unexpected or badly for
matted. (os error -2146893018)
2: The message received was unexpected or badly formatted. (os error -214689
3018)

Output of “cmk --debug -vvn hostname”: (If it is a problem with checks or plugins)

Forgot to mention that this is a Windows 2012 R2 host so there might be support/incompatibility with the version of TLS between Windows 2012 R2 server and Checkmk 2.1. Any feedback would be appreciated.

Hi,

in the register-command use --server checkmk without the port, maybe there is a formatting problem with that. Port 8000 will be used as default anyway.

Cheers Jeronimo

Not sure why you commented your own post…
We use system center to register and deploying the agent with a custom PS script. (That does some other tings as well)

That seemed to have worked great thanks “jwiederh”. Are you aware of any automation scripts/commands methods with registering agent/TLS for over 800+ hosts?

Corrected sorry newbie. Good ol Microsoft SC i think ill look into other methods for windows such as PSDEPLOY and Ansible for linux

Yea that depends on your install base I guess, our is to large to run Ansible as it would take way to long…

Anders, out of curiosity, what command/syntax did you run to use for automating agent registration. I notice utilizing %computername% doesnt work periodically as some of my implemented hosts in Checkmk are lower/upper case. Not my doing. Do you know of a syntax to use? Something has to work as surely i dont need to run registration manually on 800+ hosts. I have been looking everywhere for some feedback. I will also need a syntax for Linux as well.

“C:\Program Files (x86)\checkmk\service\check_mk_agent.exe” ^
updater register -s checkmk.mnp.ca -i monitoring -H %computername% -p https -U userx -P userx -v

We don’t use computer name at all as we have FQDN in Checkmk (We have multiple domains as well)
So we rely on the TCP/IP settings that I get in PS, like below. Hosts are added to Checkmk using automation and from our CMDB where they are always in lowercase so not a big problem, at least for us.

$Hostname = (gpv HKLM:\SYSTEM\CurrentControlSet\services\Tcpip\Parameters HostName, Domain) -join '.'