KeyError ('percpu_usage')

Hello there, after updating CMK Appliance to 1.6.0p20 and baking new Agents, our Docker hosts has the following error for all Containers for Service Check_MK Discovery:

KeyError ('percpu_usage')

Trace:

File “/omd/sites/mobilfunk/lib/python/cmk_base/decorator.py”, line 58, in wrapped_check_func
status, infotexts, long_infotexts, perfdata = check_func(hostname, *args, **kwargs)
File “/omd/sites/mobilfunk/lib/python/cmk_base/discovery.py”, line 426, in check_discovery
on_error=“raise”)
File “/omd/sites/mobilfunk/lib/python/cmk_base/discovery.py”, line 1061, in _get_host_services
return _get_node_services(host_config, ipaddress, sources, multi_host_sections, on_error)
File “/omd/sites/mobilfunk/lib/python/cmk_base/discovery.py”, line 1069, in _get_node_services
multi_host_sections, on_error)
File “/omd/sites/mobilfunk/lib/python/cmk_base/discovery.py”, line 1102, in _get_discovered_services
multi_host_sections, on_error)
File “/omd/sites/mobilfunk/lib/python/cmk_base/discovery.py”, line 838, in _discover_services
check_plugin_name, on_error):
File “/omd/sites/mobilfunk/lib/python/cmk_base/data_sources/host_sections.py”, line 299, in _update_with_parse_function
return parse_function(section_content)
File “/omd/sites/mobilfunk/share/check_mk/checks/docker_container_cpu”, line 42, in parse_docker_container_cpu
parsed[“num_cpus”] = len(raw[‘cpu_usage’][‘percpu_usage’])

docker -v
Docker version 20.10.2, build 2291f61

Hello CyberLine,

I’m currently working on this problem. Could you share some information about your setup and the containers so I can reproduce this problem locally? Is the problem still present?

  • What does docker stats --no-stream report for the containers?
  • What Operation System do you use for the docker host?
  • What was the checkmk version before the update?

Thanks in advanced,
Benedikt

CONTAINER ID   NAME                  CPU %     MEM USAGE / LIMIT     MEM %     NET I/O           BLOCK I/O         PIDS
8c6deb91a2f4   packagist-worker      30.84%    681.2MiB / 7.769GiB   8.56%     125GB / 58.6GB    13.9GB / 12.3GB   21
10908fd7b6d2   packagist-web         0.00%     13.16MiB / 7.769GiB   0.17%     304GB / 28.7GB    32.6MB / 2.05GB   4
bb5595c6390c   packagist-ui          0.00%     196.6MiB / 7.769GiB   2.47%     4.51GB / 831MB    5.1GB / 5.34GB    7
f06d1a624023   packagist-repo        0.00%     177.2MiB / 7.769GiB   2.23%     30.8GB / 311GB    5GB / 4.9GB       7
0cb1ccbdd616   packagist-postgres    2.37%     498MiB / 7.769GiB     6.26%     53.7GB / 127GB    39.5GB / 218GB    20
657a56473ac2   packagist-redis       0.37%     38.24MiB / 7.769GiB   0.48%     11.5GB / 29.1GB   175MB / 194GB     4
9b4af5ff7324   replicated-statsd     0.98%     77.73MiB / 7.769GiB   0.98%     13GB / 3.43MB     1.34GB / 197GB    20
b795755fcf35   retraced-processor    14.28%    115.4MiB / 7.769GiB   1.45%     1.73GB / 3.33GB   32.8MB / 55.9MB   9
5ffcb4c31f00   retraced-api          0.00%     27.38MiB / 7.769GiB   0.34%     259kB / 422kB     72.5MB / 274MB    9
2a53bde5377a   retraced-cron         3.21%     22.41MiB / 7.769GiB   0.28%     1.24GB / 1.67GB   91.4MB / 3.15MB   17
a54c1a3a9554   retraced-postgres     10.44%    39.64MiB / 7.769GiB   0.50%     2.93GB / 1.26GB   169MB / 11.7GB    12
0e654fa952aa   retraced-nsqd         1.44%     14.09MiB / 7.769GiB   0.18%     2.08GB / 1.98GB   17.1MB / 620MB    15
c9dfb1dfa622   replicated-premkit    0.00%     10MiB / 7.769GiB      0.13%     190kB / 97.3kB    8.25MB / 795kB    7
dd94fe9d7586   replicated-operator   0.72%     47.4MiB / 7.769GiB    0.60%     2.27GB / 20.9GB   173MB / 472MB     13
ca323da1b9d9   replicated            0.21%     282.5MiB / 7.769GiB   3.55%     27GB / 31.2GB     120GB / 192GB     15
cc091e8116c8   replicated-ui         0.00%     20MiB / 7.769GiB      0.25%     153kB / 0B        81.5MB / 8.82MB   10

Docker Host is Debian 10.7
Old Check_MK Version was 1.6.0p11.cee

Thanks for the info! The Error should be fixed with Werk #12306: docker_container_cpu: fix `KeyError (percpu_usage)` crash

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact @fayepal if you think this should be re-opened.