From 4611e41bc50d15275b316c6f21b688997a9c78c4 Mon Sep 17 00:00:00 2001 From: Thomas Guyot-Sionnest Date: Fri, 4 Feb 2011 00:54:52 -0500 Subject: check_http: check for and print the certificate cn MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch adds a check for the certificate cn (hostname) to normal certificate checks. It returns CRITICAL if th cn is missing, otherwise it prints it in the normal output. Patch by Stéphane Urbanovski --- plugins/tests/check_http.t | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'plugins/tests') diff --git a/plugins/tests/check_http.t b/plugins/tests/check_http.t index 74eff175..9ae6bbdc 100755 --- a/plugins/tests/check_http.t +++ b/plugins/tests/check_http.t @@ -182,17 +182,17 @@ SKIP: { $result = NPTest->testCmd( "$command -p $port_https -S -C 14" ); is( $result->return_code, 0, "$command -p $port_https -S -C 14" ); - is( $result->output, 'OK - Certificate will expire on 03/03/2019 21:41.', "output ok" ); + is( $result->output, 'OK - Certificate \'Ton Voon\' will expire on 03/03/2019 21:41.', "output ok" ); $result = NPTest->testCmd( "$command -p $port_https -S -C 14000" ); is( $result->return_code, 1, "$command -p $port_https -S -C 14000" ); - like( $result->output, '/WARNING - Certificate expires in \d+ day\(s\) \(03/03/2019 21:41\)./', "output ok" ); + like( $result->output, '/WARNING - Certificate \'Ton Voon\' expires in \d+ day\(s\) \(03/03/2019 21:41\)./', "output ok" ); # Expired cert tests $result = NPTest->testCmd( "$command -p $port_https_expired -S -C 7" ); is( $result->return_code, 2, "$command -p $port_https_expired -S -C 7" ); is( $result->output, - 'CRITICAL - Certificate expired on 03/05/2009 00:13.', + 'CRITICAL - Certificate \'Ton Voon\' expired on 03/05/2009 00:13.', "output ok" ); } -- cgit v1.2.3-74-g34f1