CMK version: 2.3.0p35
OS version: Ubuntu 22.04
Error message: Broken Pipe
In the file lib/python3/cmk/checkengine/submitters.py on line 213 (pipe.flush) we get an BrokenPipeError when the details of a service get huge. My workaround is as follows (reopening the Pipe):
try:
pipe.write(msg.encode())
# Important: Nagios needs the complete command in one single write() block!
# Python buffers and sends chunks of 4096 bytes, if we do not flush.
pipe.flush()
except BrokenPipeError as e:
pipe = PipeSubmitter._open_command_pipe()
The original code is as follows:
pipe.write(msg.encode())
# Important: Nagios needs the complete command in one single write() block!
# Python buffers and sends chunks of 4096 bytes, if we do not flush.
pipe.flush()
Is there a better way than this in order to fix this issue?