diff --git a/src/checkmk_kube_agent/send_metrics.py b/src/checkmk_kube_agent/send_metrics.py index 9ef47c8..8084a17 100644 --- a/src/checkmk_kube_agent/send_metrics.py +++ b/src/checkmk_kube_agent/send_metrics.py @@ -374,7 +374,7 @@ def machine_sections_worker( stdout=subprocess.PIPE, ) as process: (out, err) = process.communicate(timeout=5) - if returncode != 0: + if process.returncode != 0: # we don't capture stderr so it's printed to stderr of this process # and hopefully contains a helpful error message... raise RuntimeError("Agent execution failed.")