Closed timatlee closed 1 year ago
Hi @timatlee and thanks for your extensive report.
If I got everything correctly, I think there is a misunderstanding at play here. The agent role does not automatically bake agents. When you install the agent and add the host to the monitoring, you have to run "Bake and sign agents" yourself through the UI. Only then will the host show up in the agent configurations overview.
Yeah, I don't think I expected the role to bake the agent, but I was trying to figure how get the role to install the agent, then get updates from the bakery.
/var/lib/check_mk_agent/
, /var/lib/cmk-agent/
and /etc/check_mk
After a long while, I'm not seeing the installed agent pick up configured plugins. Checking the Automatic Updates window in CMK, it tells me that no agents are registered.
Do I need to follow up with a shell call to cmk-update-agent register
?
I suppose I'm a bit confused, because reading the manual, I'm supposed to download the baked agent and install that .. but I don't believe I understand how to configure the role to do that.
Thanks!
Generally, no purging is necessary, as the role is idempotent for the most part. The log shows, that the registration for updates is successful, so your host should show up as registered in Checkmk. The generic agent is used for installation, as at that time, no host specific agent is available. After a while the updater should pull the correct agent.
There should be no need for manual intervention.
What does the Check_MK Agent
say, after the role has run?
This issue has been stale for 60 days. It will close in 7 days.
Describe the bug
I don't believe that hosts are getting added to the list of agents that an agent configuration can be applied to, unless the host has been created first.
I'm open to the idea that I just don't know what I'm doing, and this is expected behaviour.
Component Name
agent role - activation ?
Ansible Version
Checkmk Version
Collection Version
Environment
Debian Linux 5.15.85-1-pve #1 SMP PVE 5.15.85-1 (2023-02-01T00:00Z) x86_64 GNU/Linux
Python 3.9.2
To Reproduce
To re-create, I can:
Likewise, the Agent configuration screen does not show the newly added host:
Repeating step 1 (deleted host from CMK UI, purged agent from monitored host, etc...)
Adding monitored host to the appropriate folder, and activate changes. The list of hosts in the Agent configuration screen shows the newly added host:
Execute playbook to install agent and register. I see the host-specific agent installed:
TASK [tribe29.checkmk.agent : Debian Derivatives: Download host-specific Checkmk CFE Agent.] *** ok: [ansible]
TASK [tribe29.checkmk.agent : Debian Derivates: Transfer host-specific Checkmk CFE Agent.] ***** skipping: [ansible]
TASK [tribe29.checkmk.agent : Debian Derivatives: Install host-specific Checkmk CFE Agent.] **** changed: [ansible]
TASK [tribe29.checkmk.agent : Debian Derivatives: Download GENERIC Checkmk CFE Agent.] ***** skipping: [ansible]
TASK [tribe29.checkmk.agent : Debian Derivates: Transfer GENERIC Checkmk CFE Agent.] *** skipping: [ansible]
TASK [tribe29.checkmk.agent : Debian Derivatives: Install GENERIC Checkmk CFE Agent.] ** skipping: [ansible]
TASK [tribe29.checkmk.agent : Debian Derivatives: Install Checkmk CRE Agent.] ** skipping: [ansible]
TASK [tribe29.checkmk.agent : Create host on server.] ** [DEPRECATION WARNING]: Alias 'host_name' is deprecated. See the module docs for more information. This feature will be removed from tribe29.checkmk in a release after 2024-01-01. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg. ok: [ansible -> localhost]
TASK [tribe29.checkmk.agent : Check for Agent Updater Binary.] ***** ok: [ansible]
TASK [tribe29.checkmk.agent : Check for Agent Controller Binary.] ** ok: [ansible]
TASK [tribe29.checkmk.agent : Register Agent for automatic Upates using User Password.] **** skipping: [ansible]
TASK [tribe29.checkmk.agent : Register Agent for automatic Upates using Automation Secret.] **** changed: [ansible]
TASK [tribe29.checkmk.agent : Trigger Activate Changes to enable TLS registration.] ****
TASK [tribe29.checkmk.agent : Register Agent for TLS.] ***** changed: [ansible]
TASK [tribe29.checkmk.agent : Discover services and labels on host.] *** changed: [ansible -> localhost]
RUNNING HANDLER [tribe29.checkmk.agent : Activate Changes.] **** changed: [ansible -> localhost]
PLAY RECAP ***** ansible : ok=15 changed=5 unreachable=0 failed=0 skipped=9 rescued=0 ignored=0