summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephane Lapie <stephane.lapie@asahinet.com>2017-06-07 06:12:53 (GMT)
committerStephane Lapie <stephane.lapie@asahinet.com>2017-06-07 06:12:53 (GMT)
commit541322969e27b07566c55448d749bc64ab7ae5c0 (patch)
tree86aaf41190f936ce111a034f4fa7b0f096946096
parentb3d39e605ef7ce7da056721c4e2e140966be3530 (diff)
downloadmonitoring-plugins-5413229.tar.gz
Fix regexp for nullmailer "mailq" outputrefs/pull/1493/head
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.
-rwxr-xr-xplugins-scripts/check_mailq.pl2
1 files changed, 1 insertions, 1 deletions
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" ) {
533 while (<MAILQ>) { 533 while (<MAILQ>) {
534 #2006-06-22 16:00:00 282 bytes 534 #2006-06-22 16:00:00 282 bytes
535 535
536 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$/) { 536 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/) {
537 $msg_q++ ; 537 $msg_q++ ;
538 } 538 }
539 } 539 }