aboutsummaryrefslogtreecommitdiff
path: root/plugins-scripts/check_mailq.pl
diff options
context:
space:
mode:
authorGravatar Stephane Lapie <stephane.lapie@asahinet.com> 2017-06-07 15:12:53 +0900
committerGravatar Stephane Lapie <stephane.lapie@asahinet.com> 2017-06-07 15:12:53 +0900
commit541322969e27b07566c55448d749bc64ab7ae5c0 (patch)
tree86aaf41190f936ce111a034f4fa7b0f096946096 /plugins-scripts/check_mailq.pl
parentb3d39e605ef7ce7da056721c4e2e140966be3530 (diff)
downloadmonitoring-plugins-541322969e27b07566c55448d749bc64ab7ae5c0.tar.gz
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.
Diffstat (limited to 'plugins-scripts/check_mailq.pl')
-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 32f498d3..1fc15ffc 100755
--- a/plugins-scripts/check_mailq.pl
+++ b/plugins-scripts/check_mailq.pl
@@ -533,7 +533,7 @@ elsif ( $mailq eq "nullmailer" ) {
while (<MAILQ>) {
#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++ ;
}
}