Output not complete SSL Check

Hi Everyone

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.
image this is the wrapper
the following is the output in the shell
image
output in icinga
image

It is not a thing of sdtout and sdterr.

can some please help me?

if I leave out the grep I get the message from a normal tcp check with the CERT prefix (CERT TCP OK…)

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.

Regards
Alex

HI Alex

Thank you for your response.

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.

Hi.

I tested with your settings and the output was displayed correctly in icingaweb2.

One thing that may be possible are problems with the line-endings.

Could you please verify the line-endings of the plugin-output?

You can also try adding escape-values by:
tcp_escape_send # e.g. : vars.tcp_escape_send = "\r\n"


Greetings.

Hello @seekbat,
The two lines should show in your Icingaweb plugin output. A picture of my Icingaweb plugin output is below showing the two lines.