CMK version: 2.0.0p18 (CME)
OS version: CheckMK Server CentOS 7, Agent Server CentOS 7
I have a single host out of a group of hosts where the agent was deployed via automation (salt master server) that reports the agent is not registered. When I attempt to register manually it fails reporting the following at the command line.
Going to register agent at deployment server
Unexpected answer from Checkmk server: Missing json data. Maybe we are talking to an agent bakery from before Checkmk 2.0 ?
See syslog or Logfile at /var/lib/check_mk_agent/cmk-update-agent.log for details.
To make sure the wrong agent wasn’t installed or an install error did not occur, I removed the checkmk agent using yum remove and deleted the .state and log files.
I checked the bakery on the checkmk server side and confirmed the host name in question was listed next to the baked agent version. I pulled a fresh RPM file and installed using yum install.
Afterwards, I ran registration again using the following syntax with the same result.
# /usr/bin/cmk-update-agent register -v -s corpnms01.corporate.local -i corpnms -H web03-2.prod.corporate.local -U automation -S [redacted]
Updated the certificate store "/var/lib/check_mk_agent/cas/all_certs.pem" with 1 certificate(s)
Going to register agent at deployment server
Unexpected answer from Checkmk server: Missing json data. Maybe we are talking to an agent bakery from before Checkmk 2.0 ?
See syslog or Logfile at /var/lib/check_mk_agent/cmk-update-agent.log for details.
/var/log/messages
Jul 12 20:46:44 web03-2 journal: [cmk-update-agent] ERROR: Unexpected answer from Checkmk server: Missing json data. Maybe we are talking to an agent bakery from before Checkmk 2.0 ?
/var/lib/check_mk_agent/cmk-update-agent.log
2022-07-12 20:31:22,221 INFO: Updated the certificate store "/var/lib/check_mk_agent/cas/all_certs.pem" with 1 certificate(s)
2022-07-12 20:31:22,221 INFO: Starting Update mode as plugin.
2022-07-12 20:31:22,221 DEBUG: No state file found yet. New state data will be saved to /etc/cmk-update-agent.state
2022-07-12 20:31:22,223 DEBUG: Saved deployment status to /etc/cmk-update-agent.state.
2022-07-12 20:31:22,223 DEBUG: Caught Exception:
Traceback (most recent call last):
File "cmk_update_agent.py", line 1208, in _do_update_as_plugin
File "cmk_update_agent.py", line 1242, in _do_update_agent
Exception: The agent updater is not registered at the deployment server
2022-07-12 20:31:22,223 DEBUG: Writing agent section to stdout:
<<<check_mk>>>
AgentUpdate: last_check None last_update None aghash None pending_hash None update_url https://corpnms01.prod.corporate.local/corpnms/check_mk error The agent updater is not registered at the deployment server
2022-07-12 20:31:22,223 DEBUG: Sending new state data to agent bakery
2022-07-12 20:31:22,223 DEBUG: Fetching content (using requests): https://corpnms01.prod.corporate.local/corpnms/check_mk/deploy_agent.py
2022-07-12 20:31:22,374 DEBUG: Response from agent bakery:
{'result_code': 1, 'result': 'Missing host name', 'severity': 'error'}
2022-07-12 20:31:22,374 DEBUG: Caught error from Agent Bakery. Details:
Missing host name
2022-07-12 20:31:22,374 DEBUG: Caught Exception:
Traceback (most recent call last):
File "cmk_update_agent.py", line 1236, in _push_status
File "cmk_update_agent.py", line 1353, in _fetch_agent_info
File "cmk_update_agent.py", line 316, in fetch_data_from_server
File "cmk_update_agent.py", line 349, in _do_request
File "cmk_update_agent.py", line 395, in _check_for_response_error
Exception: Agent Bakery: Missing host name
2022-07-12 20:31:22,375 DEBUG: Done.
2022-07-12 20:31:41,451 DEBUG: Starting Checkmk Agent Updater v2.0.0p18
2022-07-12 20:31:41,451 DEBUG: Successfully read /etc/cmk-update-agent.state.
2022-07-12 20:31:41,452 DEBUG: Successfully read /etc/check_mk/cmk-update-agent.cfg.
2022-07-12 20:31:41,452 DEBUG: Updating the certificate store "/var/lib/check_mk_agent/cas/all_certs.pem"...
2022-07-12 20:31:41,455 INFO: Updated the certificate store "/var/lib/check_mk_agent/cas/all_certs.pem" with 1 certificate(s)
2022-07-12 20:31:41,455 DEBUG: Starting Registration Mode.
2022-07-12 20:31:41,455 INFO: Going to register agent at deployment server
2022-07-12 20:31:41,455 DEBUG: Fetching content (using requests): https://corpnms01.prod.corporate.local/corpnms/check_mk/register_agent.py
2022-07-12 20:31:42,510 DEBUG: Response from agent bakery:
Internal error: 'list' object has no attribute 'update'
An internal error occured while processing your request. You can report this issue to the Checkmk team to help fixing this issue. Please open the crash report page and use the form for reporting the problem.
{"result_code": 1, "result": "'list' object has no attribute 'update'", "severity": "error"}
2022-07-12 20:31:42,510 DEBUG: Caught Exception:
Traceback (most recent call last):
File "cmk_update_agent.py", line 1889, in main
File "cmk_update_agent.py", line 878, in run
File "cmk_update_agent.py", line 1001, in _run_mode
File "cmk_update_agent.py", line 1108, in _register_agent
File "cmk_update_agent.py", line 316, in fetch_data_from_server
File "cmk_update_agent.py", line 349, in _do_request
File "cmk_update_agent.py", line 398, in _check_for_response_error
Exception: Unexpected answer from Checkmk server: Missing json data. Maybe we are talking to an agent bakery from before Checkmk 2.0 ?
2022-07-12 20:31:42,511 ERROR: Unexpected answer from Checkmk server: Missing json data. Maybe we are talking to an agent bakery from before Checkmk 2.0 ?
Given the error ‘missing host name’ I also tried registering using --hostname as well as without any options to have it prompt.
Thanks in advance for any guidance.
Sincerely,
Scotsie