After digging around a bit, I found the reason for the check not being distributed alongside the agent:
cmk --debug --force -v -A HOSTNAME
HOSTNAME...Found no Python 2 version for cmk_update_agent.py, deploying with Python 3 support only.linux_deb:baking...ERROR
Traceback (most recent call last):
File "/omd/sites/mysite/bin/cmk", line 92, in <module>
exit_status = modes.call(mode_name, mode_args, opts, args)
File "/omd/sites/mysite/lib/python3/cmk/base/modes/__init__.py", line 69, in call
return handler(*handler_args)
File "/omd/sites/mysite/lib/python3/cmk/base/modes/cee.py", line 61, in mode_bake_agents
agent_bakery.bake_agents_for_wato_mode(options, hostnames)
File "/omd/sites/mysite/lib/python3/cmk/base/cee/bakery/agent_bakery.py", line 1701, in bake_agents_for_wato_mode
_do_bake_agents(options=options, host_names=args)
File "/omd/sites/mysite/lib/python3/cmk/base/cee/bakery/agent_bakery.py", line 1718, in _do_bake_agents
AgentBakery(
File "/omd/sites/mysite/lib/python3/cmk/base/cee/bakery/agent_bakery.py", line 1292, in bake_agents
self._bake_agents_for_host(hostname, bakelet_cache)
File "/omd/sites/mysite/lib/python3/cmk/base/cee/bakery/agent_bakery.py", line 1426, in _bake_agents_for_host
AgentBaker(warnings_buffer=self._warnings_buffer,
File "/omd/sites/mysite/lib/python3/cmk/base/cee/bakery/agent_bakery.py", line 1528, in bake
self._bake_agent_for_platform(self._hostname, platform)
File "/omd/sites/mysite/lib/python3/cmk/base/cee/bakery/agent_bakery.py", line 1553, in _bake_agent_for_platform
self._update_package(hostname, agent_package_path, platform)
File "/omd/sites/mysite/lib/python3/cmk/base/cee/bakery/agent_bakery.py", line 1602, in _update_package
self._make_package_files(agent_package_path, platform)
File "/omd/sites/mysite/lib/python3/cmk/base/cee/bakery/agent_bakery.py", line 1622, in _make_package_files
self._execute_bake_function(platform, package_path)
File "/omd/sites/mysite/lib/python3/cmk/base/cee/bakery/agent_bakery.py", line 1651, in _execute_bake_function
builder_lookup[platform](warnings_buffer=self._warnings_buffer,
File "/omd/sites/mysite/lib/python3/cmk/base/cee/bakery/agent_bakery.py", line 371, in build
files_root = self._ensure_files()
File "/omd/sites/mysite/lib/python3/cmk/base/cee/bakery/agent_bakery.py", line 391, in _ensure_files
self._place_files(files_root)
File "/omd/sites/mysite/lib/python3/cmk/base/cee/bakery/agent_bakery.py", line 451, in _place_files
self._create_unix_agent_pre_17_plugin_files(files_root)
File "/omd/sites/mysite/lib/python3/cmk/base/cee/bakery/agent_bakery.py", line 475, in _create_unix_agent_pre_17_plugin_files
self._create_pre_17_plugin_files(conf_dir, plugins_dir)
File "/omd/sites/mysite/lib/python3/cmk/base/cee/bakery/agent_bakery.py", line 407, in _create_pre_17_plugin_files
self._execute_pre_17_bakery_plugin(name, conf_dir, plugins_dir)
File "/omd/sites/mysite/lib/python3/cmk/base/cee/bakery/agent_bakery.py", line 426, in _execute_pre_17_bakery_plugin
bake_func(**func_args)
File "<string>", line 21, in bake_dir_size
NameError: name 'shutil' is not defined
I searched for the last mentioned file <string>
but to no avail.
Does anybody know what’s wrong here?
NameError: name 'shutil' not defined
sounds like CheckMK does not find shutil?
When I start a python3 shell with python3
and issue import shutil
there is no error, so python3 knows about shutil but CheckMK doesn’t?
Or is something wrong with the check itself?
[EDIT]
Also, CheckMK Agent Bakery shows that something is wrong with the agent after baking.
Agent with dir_size

(you can also see the Linux Agent DEB Package is missing here)
Agent without dir_size
