Failed to discover agent receiver port error when registering linux host

Trying to follow the doc to register linux host. I get this when running

root@linux# cmk-agent-ctl register --hostname mynewhost \
    --server cmkserver --site mysite \
    --user automation --password 'test23'

I see I have legacy mode enabled when I run cmk-agent-ctl status. Would this be a problem?

CMK version: 2.2.0p20
OS version: Ubuntu 15~22.04.1

Error message: [cmk_agent_ctl::site_spec] Failed to discover agent receiver port using http

You can give also the agent receiver port if it cannot be found.
ā€œā€“server cmkserver:8000ā€ or the correct port for your site.

1 Like

Thank you for the Recommendation Andreas. I am very new to checkmk. I think I got the site , hostname, server and user good now. I get a Cert rendered but when I hit ā€˜Y’ to establish the connection I get the following error

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

y
ERROR [cmk_agent+ctl] Error registering existing host at http://vm3:8000/ubuntuMonitoring

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

Any suggestion would be greatly appreciated.

Thank you for your time.

In your site should exists an user with name ā€œautomationā€ and also with user type ā€œautomationā€. Is this user there? If you not, you need to create an automation user with name ā€œautomationā€.
If the site is existing longer and was updated, this is a common problem.
For new sites it should not happen.

I have the user automation and setup a password which I added to my command. I get the prompt to proceed with the registration but then it fails with a 500.

Found the solution!

Ok so for the automation user, it needs to use the secret option. Registration will fail if you try and use the password for the user. For future people having the same issue the syntax for the registration command is as follows

cmk-agent-ctl register --hostname <hostname created in checkmk> \
    --server <IP of your linux server or DNS>:<Port> --site mysite \
    --user automation --password '<Automation Secret for Machine Accounts>'

Port can be found by running

omd config <sitename> show | grep AGENT_RECEIVED

The secret can be found under the Setup>Users>Properties Automation User>Security

1 Like

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.