From 4d06603060fc1233861b164870f0d3a2e0d8d2eb Mon Sep 17 00:00:00 2001 From: Ton Voon Date: Fri, 15 Jul 2011 21:19:15 +0100 Subject: Fix check_smtp and check_tcp where duplicate messages were displayed for certificate errors (Opsview team) --- plugins/check_smtp.c | 3 --- plugins/check_tcp.c | 5 +---- 2 files changed, 1 insertion(+), 7 deletions(-) (limited to 'plugins') diff --git a/plugins/check_smtp.c b/plugins/check_smtp.c index 6c5994c0..494bc2cd 100644 --- a/plugins/check_smtp.c +++ b/plugins/check_smtp.c @@ -276,9 +276,6 @@ main (int argc, char **argv) # ifdef USE_OPENSSL if ( check_cert ) { result = np_net_ssl_check_cert(days_till_exp); - if(result != STATE_OK){ - printf ("%s\n", _("CRITICAL - Cannot retrieve server certificate.")); - } my_close(); return result; } diff --git a/plugins/check_tcp.c b/plugins/check_tcp.c index 178bd568..d3c92a49 100644 --- a/plugins/check_tcp.c +++ b/plugins/check_tcp.c @@ -236,12 +236,9 @@ main (int argc, char **argv) result = np_net_ssl_init(sd); if (result == STATE_OK && check_cert == TRUE) { result = np_net_ssl_check_cert(days_till_exp); - if(result != STATE_OK) { - printf(_("CRITICAL - Cannot retrieve server certificate.\n")); - } } } - if(result != STATE_OK){ + if(result != STATE_OK || check_cert == TRUE){ np_net_ssl_cleanup(); if(sd) close(sd); return result; -- cgit v1.2.3-74-g34f1