diff options
author | Lorenz <12514511+RincewindsHat@users.noreply.github.com> | 2023-03-12 21:59:13 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-12 21:59:13 +0100 |
commit | 40dc41225a3ce86bd6f1f446920cd5a6c32b8443 (patch) | |
tree | 6c0eaf47062aaeb65580365bc9f0ddc594dfa29f | |
parent | 0c54644f6aab69066fb14a633d46aa8b6bf8c0f0 (diff) | |
parent | 12ae1fb6627bfef419fb4571a7189909107f5e6e (diff) | |
download | monitoring-plugins-40dc412.tar.gz |
Merge pull request #1192 from waja/github972
check_mailq.pl: separate submission queue
-rw-r--r-- | THANKS.in | 1 | ||||
-rwxr-xr-x | plugins-scripts/check_mailq.pl | 36 |
2 files changed, 31 insertions, 6 deletions
@@ -405,3 +405,4 @@ Robert Bohne | |||
405 | Wolfgang Nieder | 405 | Wolfgang Nieder |
406 | andrew bezella | 406 | andrew bezella |
407 | Lorenz Gruenwald | 407 | Lorenz Gruenwald |
408 | John Morrissey | ||
diff --git a/plugins-scripts/check_mailq.pl b/plugins-scripts/check_mailq.pl index 27073d3c..f02c90fb 100755 --- a/plugins-scripts/check_mailq.pl +++ b/plugins-scripts/check_mailq.pl | |||
@@ -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 | } |