From 541322969e27b07566c55448d749bc64ab7ae5c0 Mon Sep 17 00:00:00 2001 From: Stephane Lapie Date: Wed, 7 Jun 2017 15:12:53 +0900 Subject: Fix regexp for nullmailer "mailq" output As it currently is, the regular expression does not match mailq command output on a Debian Jessie setup. Three erroneous behaviors fixed : - Meaningful lines do not end with the "bytes" word - There might be one or more space before the byte count, not 2 - Time match was completely broken, it only accounted for 0-29 minutes and 0-29 seconds. diff --git a/plugins-scripts/check_mailq.pl b/plugins-scripts/check_mailq.pl index 32f498d..1fc15ff 100755 --- a/plugins-scripts/check_mailq.pl +++ b/plugins-scripts/check_mailq.pl @@ -533,7 +533,7 @@ elsif ( $mailq eq "nullmailer" ) { while () { #2006-06-22 16:00:00 282 bytes - if (/^[1-9][0-9]*-[01][0-9]-[0-3][0-9]\s[0-2][0-9]\:[0-2][0-9]\:[0-2][0-9]\s{2}[0-9]+\sbytes$/) { + if (/^[1-9][0-9]*-[01][0-9]-[0-3][0-9]\s[0-2][0-9]\:[0-5][0-9]\:[0-5][0-9]\s+[0-9]+\sbytes/) { $msg_q++ ; } } -- cgit v0.10-9-g596f