Wow, this is now a bug of the very special kind

OK, of course my custom plugin worked fine as long as it was the last one in the chain. The problem did raise only in conjunction with the following Redis check.
You wouldn’t believe, what the reason is: A missing \n 
I admit I had a bad feeling when I first monitored the output of my plugin:
#!/bin/sh
echo '<<<linux_rtsp_server>>>'
curl http://127.0.0.1:8081
I’m testing here the presence of a special API on my RTSP server, which is not exposed to the outer world. The result is - as always with curl
- the plain body of the message (expected OK message: 404 page not found
- yes, this is OK :))
It looked weird in the console, but it worked for itself (together with a python script on the host, which parsed the result)
ubuntu@ip-172-31-76-28:/usr/lib/check_mk_agent/plugins$ ~/linux_rtsp_server
<<<linux_rtsp_server>>>
404 page not foundubuntu@ip-172-31-76-28:/usr/lib/check_mk_agent/plugins$
Note the missing \n
.
In fact, I could make this together with the REDIS check run after adding an echo
:
#!/bin/sh
echo '<<<linux_rtsp_server>>>'
curl http://127.0.0.1:8081; echo
So verdict is: If a host plugin returns an “incomplete line” (let me say it this way), the Check_MK breaks… Well, somehow. Leave it up to you to find the correct reason.
This is not explicitly stated like so in the documentation. I also could only find it after spending some hours on it and in the end by mutual exclusion only. No debug means did help to find this. No documentation either (or I have overseen it, sorry if).
Case solved for me.
Thanks