summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandrew bezella <abezella@archive.org>2022-10-19 21:33:18 +0200
committerwaja <waja@users.noreply.github.com>2023-01-18 22:09:12 +0100
commit916572c1aecc37ebfea474f952df61d15d2f60b8 (patch)
treea9e034457dca771b209d923bd214659e97b31a4b
parent72147140ed6c9a06db722930e893c90a230e6da9 (diff)
downloadmonitoring-plugins-916572c.tar.gz
Fixing nullmailer regex
attached is a patch that updates the format expected in the nullmailer mailq output. the regex is a little more flexible and less specific than the previous version.
-rwxr-xr-xplugins-scripts/check_mailq.pl4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins-scripts/check_mailq.pl b/plugins-scripts/check_mailq.pl
index 4c72332a..27073d3c 100755
--- a/plugins-scripts/check_mailq.pl
+++ b/plugins-scripts/check_mailq.pl
@@ -537,9 +537,9 @@ elsif ( $mailq eq "nullmailer" ) {
537 } 537 }
538 538
539 while (<MAILQ>) { 539 while (<MAILQ>) {
540 #2006-06-22 16:00:00 282 bytes 540 #2022-08-25 01:30:40 502 bytes from <user@example.com>
541 541
542 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/) { 542 if (/^\d{4}-\d{2}-\d{2}\s+\d{2}\:\d{2}\:\d{2}\s+\d+\sbytes/) {
543 $msg_q++ ; 543 $msg_q++ ;
544 } 544 }
545 } 545 }