I have a strange behavior of the check_tcp script.
I want to check the certificates of a Host. If the result is ok, i get 2 lines of output of the script but only the second one gets into icinga.
First I thaught that it is a thing with 2 lines of output. So I made a wrapper to only output the first line.
Now I don’t get any output. this is the wrapper
the following is the output in the shell
output in icinga
Hello Olivier,
Thanks for joining the Icinga community. Are you writing you own plugin for this check for a certain reason? Did you know the check_tcp standard plugin already has a check for certificate expiration time available.
check_tcp -H mywebsite -D 30,10 -p 443
Please run “check_tcp --help” to review the plugin options or review the online documentation for more details.
I’m actually doing exactly that. But the Problem is that if the Check is OK i get two lines back.
/usr/lib/nagios/plugins/check_tcp -p 443 -D 30,2 -t 10 -H eevent.ch --ssl
OK - Certificate '13.eevent.ch' will expire on Wed Jan 27 22:51:49 2021 +0000.
TCP OK - 0.007 second response time on eevent.ch port 443|time=0.006759s;;;0.000000;10.000000
And only the second line gets into icinga. I’m trying to get the first line into icinga. But everything i’m trying is not getting me there.