After server upgrade the linux agents still showing the old check_mk version

CMK version: 2.2.0p42.cee
OS version: redhat:enterprise_linux:9::baseos

Error message: After a server upgrade from 2.1.0p37.cee to 2.1.0p37.cee the linux agents still showing the old agent version (2.1.0p37)

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

<<<check_mk>>>
Version: 2.1.0p30
AgentOS: linux
Hostname:
AgentDirectory: /opt/cmk-agent/etc
DataDirectory: /opt/cmk-agent/var/lib
SpoolDirectory: /opt/cmk-agent/var/lib/spool
PluginsDirectory: /opt/cmk-agent/lib/plugins
LocalDirectory: /opt/cmk-agent/lib/local
FailedPythonReason:
SSHClient:
<<<cmk_agent_ctl_status:sep(0)>>>
{“version”:“2.2.0p42”,“agent_socket_operational”:true,“ip_allowlist”:,“allow_legacy_pull”:true,“connections”:}
<<<checkmk_agent_plugins_lnx:sep(0)>>>
pluginsdir /opt/cmk-agent/lib/plugins
localdir /opt/cmk-agent/lib/local
/opt/cmk-agent/lib/plugins/mk_filestats.py:version = “2.2.0p42”
/opt/cmk-agent/lib/plugins/mk_filestats_2.py:version = “2.2.0p42”
/opt/cmk-agent/lib/plugins/300/cmk-update-agent:CMK_VERSION=“unversioned”
/opt/cmk-agent/lib/local/lql_daily_problem_stats.sh:CMK_VERSION=“unversioned”
(…)
<<<cmk_update_agent_status:sep(0):cached(1761581517,300)>>>
{“last_check”: 1761581517.0709417, “last_update”: 1759734189.440132, “aghash”: “08c392e7f4577228”, “pending_hash”: null, “update_url”: “http:///check_mk”, “trusted_certs”:

The output of the agent shows both versions in different locations. The last section (<<<cmk_update_agent_status:>>>) shows clearly that the last agent package, corresponding to the version 2.2.0p42 has been downloaded and installed, but all the linux agents still showing in the web console the older version

image

Any idea?

Thank you so much.

How do you configured the non standard paths in your agent?

You can look if you find the new agent script file somewhere else on your system.

Hi Andreas,

Thank you so much for your fast reply. I did it as in the picture.

Sorry, What you mean with “the new agent script file”? What file is that?

BR.

I would check in the system for the file “check_mk_agent”. If it is existing more than one time then one is the older and one the newer one i think.

Hi,

It is so weird. RPM says the package of the 2.2 version is installed.

image

There is only one script file in “/opt/cmk-agent/bin/check_mk_agent“, nothing else. It looks like when repackaging the agents after the upgrade did not include the last agent script in the package.

Please, Any idea to solve this?

BR

Hello,

I’ve noticed that the package you can download and install from https://<ip>/<site>/check_mk/agents/ contains the correct agent binary (version 2.2), but if I install any package inherited from 2.1, the agent binary remains at 2.1 and hasn’t been updated properly, even though I repackaged everything after the upgrade.

Please, @andreas-doehler Is there a way I could delete those packages and recreate them from scratch without losing the rules? Maybe doing something like this?

rm -rf ~/var/check_mk/agent_bakery/*

cmk --bake-agents

BR

Yes

Please look at the path “~/var/check_mk/agents/ and remove all files there.

After this you can do a –> cmk –debug -vvA

Do you might have a agent in your local directory ?

Check as site user and do a find at - find local/share/check_mk/agents
you might find some files but you should not find a file check_mk_agent

You’ve hit the nail on the head!!! There was a lost file of the old agent versión there.

Removing this file and repackaging solved the problem

Thank you so much!!!

1 Like