check_tcp: Print performance data even with -D

When using the 1.4.15 release of the Nagios Plugins, a command such as

  check_tcp -H pop.example.com -p 995 -D 14

usually produced two lines of output, e.g.:

  OK - Certificate will expire on 12/13/2014 23:59.
  TCP OK - 0.009 second response time on port 995|time=0.008849s;;;0.000000;10.000000

The second line was removed by 4d06603060.
However, as the old two-line output is a valid (though in this case
unintended) way to spit out performance data, removing the second line
might break current setups.  Therefore, we revert to the old behaviour,
at least for the moment.

The issue was reported by Jochen Bern on the "nagiosplug-devel" mailing
list (Message-ID: <4FEAE812.8030309@LINworks.de>).
This commit is contained in:
Holger Weiss 2012-06-27 17:29:11 +02:00
parent 10cf77ca5c
commit cbc8a7f313

View file

@ -238,7 +238,7 @@ main (int argc, char **argv)
result = np_net_ssl_check_cert(days_till_exp_warn, days_till_exp_crit);
}
}
if(result != STATE_OK || check_cert == TRUE){
if(result != STATE_OK){
np_net_ssl_cleanup();
if(sd) close(sd);
return result;