summaryrefslogtreecommitdiffstats
path: root/plugins-scripts/check_mailq.pl
diff options
context:
space:
mode:
authorLorenz Kästle <lorenz.kaestle@netways.de>2023-04-28 11:00:05 +0200
committerLorenz Kästle <lorenz.kaestle@netways.de>2023-04-28 11:00:05 +0200
commit34c4d13edd8ece1e928c578974218c10d25600c4 (patch)
tree96eaf64dc46c8b785d437250d42471180597a699 /plugins-scripts/check_mailq.pl
parente4ddeb7bb722b50613108da1cb51a48e84068701 (diff)
parent7cb82e6486e662fa4d2530523787d3eced266545 (diff)
downloadmonitoring-plugins-34c4d13.tar.gz
Merge branch 'master' into RincewindsHat-patch-1
Diffstat (limited to 'plugins-scripts/check_mailq.pl')
-rwxr-xr-xplugins-scripts/check_mailq.pl38
1 files changed, 31 insertions, 7 deletions
diff --git a/plugins-scripts/check_mailq.pl b/plugins-scripts/check_mailq.pl
index 27073d3c..49156af3 100755
--- a/plugins-scripts/check_mailq.pl
+++ b/plugins-scripts/check_mailq.pl
@@ -4,7 +4,7 @@
4# transmittal. 4# transmittal.
5# 5#
6# Initial version support sendmail's mailq command 6# Initial version support sendmail's mailq command
7# Support for mutiple sendmail queues (Carlos Canau) 7# Support for multiple sendmail queues (Carlos Canau)
8# Support for qmail (Benjamin Schmid) 8# Support for qmail (Benjamin Schmid)
9 9
10# License Information: 10# License Information:
@@ -149,7 +149,26 @@ if ($mailq eq "sendmail") {
149##/var/spool/mqueue/qF/df is empty 149##/var/spool/mqueue/qF/df is empty
150## Total Requests: 1 150## Total Requests: 1
151 151
152 152# separate submission/transport queues, empty
153## MSP Queue status...
154## /var/spool/mqueue-client is empty
155## Total requests: 0
156## MTA Queue status...
157## /var/spool/mqueue is empty
158## Total requests: 0
159# separate submission/transport queues: 1
160## MSP Queue status...
161## /var/spool/mqueue-client (1 request)
162## -----Q-ID----- --Size-- -----Q-Time----- ------------Sender/Recipient-----------
163## oAJEfhdW014123 5 Fri Nov 19 14:41 jwm
164## (Deferred: Connection refused by [127.0.0.1])
165## root
166## Total requests: 1
167## MTA Queue status...
168## /var/spool/mqueue is empty
169## Total requests: 0
170
171 my $this_msg_q = 0;
153 while (<MAILQ>) { 172 while (<MAILQ>) {
154 173
155 # match email addr on queue listing 174 # match email addr on queue listing
@@ -189,13 +208,18 @@ if ($mailq eq "sendmail") {
189 # 208 #
190 # single queue: first line 209 # single queue: first line
191 # multi queue: one for each queue. overwrite on multi queue below 210 # multi queue: one for each queue. overwrite on multi queue below
192 $msg_q = $1 ; 211 $this_msg_q = $1 ;
212 $msg_q += $1 ;
193 } 213 }
194 } elsif (/^\s+Total\sRequests:\s(\d+)$/i) { 214 } elsif (/^\s+Total\sRequests:\s(\d+)$/i) {
195 print "$utils::PATH_TO_MAILQ = $_ \n" if $verbose ; 215 if ($this_msg_q) {
196 # 216 $this_msg_q = 0 ;
197 # multi queue: last line 217 } else {
198 $msg_q = $1 ; 218 print "$utils::PATH_TO_MAILQ = $_ \n" if $verbose ;
219 #
220 # multi queue: last line
221 $msg_q += $1 ;
222 }
199 } 223 }
200 224
201 } 225 }