Registered host can't update automaticaly

CMK version: 2.2.0p4
OS version:linux(agent)/appliance(server)

Error message:

I had tried to register hosts to my check_mk site and teoretically is is doen without any errors but when I try to update agent i have an error that “my host is not registered” - the question is why?

Below steps how i do this

[root@myhost ~]# cmk-agent-ctl register --server monitor2 --site mysite --user cmkadmin --hostname myhost
Attempting to register at monitor2, port 8001. Server certificate details:

PEM-encoded certificate:
-----BEGIN CERTIFICATE-----
MIIC5TCCAc2gAwIBAgIUIIV1ua7HusXc1vEL7ojFspsYjeEwDQYJKoZIhvcNAQEL
BQAwITEfMB0GA1UEAwwWU2l0ZSAncHJvem5hJyBsb2NhbCBDQTAgFw0yMzA2MzAx

XL0y+/xaKo57RwLW/3LbuXq+Y36KFAAwwG0oX20dPb/R7TC8wQKwPgrnXCefcG2G
+x29qulNjBOPNjJ96pbX9SlrfSLJ4T+Hm/zOEdz6fcp2xMtohdcC2m8Nzf8w9D++
a7JgoH75w+L+ahwyOQquUNXI+uOFnMaziw==
-----END CERTIFICATE-----

Issued by:
Site ‘mysite’ local CA
Issued to:
mysite
Validity:
From Fri, 30 Jun 2023 11:25:42 +0000
To Sun, 30 Jun 3022 11:25:42 +0000

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

y

Please enter password for ‘cmkadmin’

Registration complete.

[root@myhost ~]# cmk-agent-ctl status
Version: 2.2.0p4
Agent socket: operational
IP allowlist: any

Connection: monitor2/mysite
UUID: c1403095-cb6b-4511-a29e-e47452a452e3
Local:
Connection mode: pull-agent
Connecting to receiver port: 8001
Certificate issuer: Site ‘mysite’ agent signing CA
Certificate validity: Wed, 13 Sep 2023 15:06:29 +0000 - Wed, 13 Sep 2028 15:06:29 +0000
Remote:
Connection mode: pull-agent
Hostname: myhost

[root@myhost ~]# cmk-update-agent
Agent Bakery: This host is not registered for deployment
See syslog or Logfile at /var/lib/check_mk_agent/cmk-update-agent.log for details.
[root@waw1-glutp1mifidtest ~]# cat /var/lib/check_mk_agent/cmk-update-agent.log
2023-09-13 17:07:00,697 [61480] DEBUG: Starting Checkmk Agent Updater v2.2.0p4
2023-09-13 17:07:00,697 [61480] DEBUG: Successfully read /etc/cmk-update-agent.state.
2023-09-13 17:07:00,698 [61480] DEBUG: Successfully read /etc/check_mk/cmk-update-agent.cfg.
2023-09-13 17:07:00,698 [61480] DEBUG: Running agent updater in InstallMode… Found no pending agent hash for installation. Nothing to do for us.
2023-09-13 17:07:00,698 [61480] DEBUG: Done.
2023-09-13 17:07:06,123 [61488] DEBUG: Starting Checkmk Agent Updater v2.2.0p4
2023-09-13 17:07:06,124 [61488] DEBUG: Successfully read /etc/cmk-update-agent.state.
2023-09-13 17:07:06,125 [61488] DEBUG: Successfully read /etc/check_mk/cmk-update-agent.cfg.
2023-09-13 17:07:06,125 [61488] DEBUG: Starting manual update mode.
2023-09-13 17:07:06,125 [61488] INFO: Getting target agent configuration for host ‘myhost’ from deployment server
2023-09-13 17:07:06,185 [61488] DEBUG: Fetching content (using requests): http://monitor2/mysite/check_mk/deploy_agent.py
2023-09-13 17:07:06,207 [61488] DEBUG: Response from agent bakery:
{‘result_code’: 1, ‘result’: ‘This host is not registered for deployment’, ‘severity’: ‘error’}
2023-09-13 17:07:06,207 [61488] DEBUG: Caught Exception:
Traceback (most recent call last):
File “cmk_update_agent.py”, line 2342, in main
File “cmk_update_agent.py”, line 1159, in run
File “cmk_update_agent.py”, line 1901, in _run_mode
File “cmk_update_agent.py”, line 1561, in _do_update_as_command
File “cmk_update_agent.py”, line 1621, in _do_update_agent
File “cmk_update_agent.py”, line 1673, in _get_target_state
File “cmk_update_agent.py”, line 1735, in _fetch_agent_info
File “cmk_update_agent.py”, line 496, in fetch_data_from_server
File “cmk_update_agent.py”, line 533, in _do_request
File “cmk_update_agent.py”, line 580, in _check_for_response_error
Exception: Agent Bakery: This host is not registered for deployment
2023-09-13 17:07:06,208 [61488] ERROR: Agent Bakery: This host is not registered for deployment

In GUI in “Automatic agent updates” i don’t see any registered hosts too- why?

You did the TLS registration. The registration for the agent updater is another procedure.

2 Likes

Thanks a lot - you are right. When I used below command hosts registered successfuly and now automaticaly update is working OK. Tahnks a lot for your tip

cmk-update-agent register -s monitor2 -i mysite -H monitor2 -U cmkadmin
Using previous settings from /etc/cmk-update-agent.state.
Password for user ‘cmkadmin’:

Successfully registered agent of host “monitor2” for deployment.

root@waw1-monitor2:/omd# cmk-update-agent -v

±------------------------------------------------------------------+
| |
| Checkmk Agent Updater v2.2.0p4 - Update |
| |
±------------------------------------------------------------------+
Getting target agent configuration for host ‘monitor2’ from deployment server
Target state (from deployment server):
Agent available: True
Signatures: 1
Target hash: 0ee945f48019ec74
Agent 0ee945f48019ec74 already installed.

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.