[monitoring-plugins] tests: adjust check_http to new output format

Sven Nierlein <[email protected]>
Newsgroups gmane.network.nagios.cvs
Message-ID <[email protected]>
 Module: monitoring-plugins
 Branch: master
 Commit: 948db2e3a2f97eaed7fbd268f2cdd2c6beb0288b
 Author: Sven Nierlein <[email protected]>
   Date: Mon Nov  7 22:46:06 2016 +0100
    URL: https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=948db2e

tests: adjust check_http to new output format

Signed-off-by: Sven Nierlein <[email protected]>

---

 plugins/t/check_http.t | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/plugins/t/check_http.t b/plugins/t/check_http.t
index 2b906e3..f514ca6 100644
--- a/plugins/t/check_http.t
+++ b/plugins/t/check_http.t
@@ -121,9 +121,9 @@ SKIP: {
                 $res = NPTest->testCmd("LC_TIME=C TZ=UTC ./check_http -C 1 www.verisign.com");
                 like($res->output, qr/OK - Certificate 'www.verisign.com' will expire on/, "Catch cert output");
                 is( $res->return_code, 0, "Catch cert output exit code" );
-                my($mon,$day,$hour,$min,$sec,$year) = ($res->output =~ /(\w+)\s+(\d+)\s+(\d+):(\d+):(\d+)\s+(\d+)\./);
+                my($mon,$day,$hour,$min,$sec,$year) = ($res->output =~ /(\w+)\s+(\d+)\s+(\d+):(\d+):(\d+)\s+(\d+)/);
                 if(!defined $year) {
-                    die("parsing date failed from: ".$res);
+                    die("parsing date failed from: ".$res->output);
                 }
                 my $months = {'Jan' => 0, 'Feb' => 1, 'Mar' => 2, 'Apr' => 3, 'May' => 4, 'Jun' => 5, 'Jul' => 6, 'Aug' => 7, 'Sep' => 8, 'Oct' => 9, 'Nov' => 10, 'Dec' => 11};
                 my $ts   = mktime($sec, $min, $hour, $day, $months->{$mon}, $year-1900);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.