diff options
Diffstat (limited to 'web/attachments/55352-check_mailq.pl.diff')
-rw-r--r-- | web/attachments/55352-check_mailq.pl.diff | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/web/attachments/55352-check_mailq.pl.diff b/web/attachments/55352-check_mailq.pl.diff new file mode 100644 index 0000000..0af115b --- /dev/null +++ b/web/attachments/55352-check_mailq.pl.diff | |||
@@ -0,0 +1,65 @@ | |||
1 | --- check_mailq.pl.org 2003-07-09 15:09:26.000000000 +0200 | ||
2 | +++ check_mailq.pl 2003-07-09 15:06:47.000000000 +0200 | ||
3 | @@ -462,8 +462,43 @@ | ||
4 | |||
5 | |||
6 | } # end of ($mailq eq "qmail") | ||
7 | +elsif ( $mailq eq "exim" ) { | ||
8 | + ## open mailq | ||
9 | + if ( defined $utils::PATH_TO_MAILQ && -x $utils::PATH_TO_MAILQ ) { | ||
10 | + if (! open (MAILQ, "$utils::PATH_TO_MAILQ | " ) ) { | ||
11 | + print "ERROR: could not open $utils::PATH_TO_MAILQ \n"; | ||
12 | + exit $ERRORS{'UNKNOWN'}; | ||
13 | + } | ||
14 | + }elsif( defined $utils::PATH_TO_MAILQ){ | ||
15 | + unless (-x $utils::PATH_TO_MAILQ) { | ||
16 | + print "ERROR: $utils::PATH_TO_MAILQ is not executable by (uid $>:gid($)))\n"; | ||
17 | + exit $ERRORS{'UNKNOWN'}; | ||
18 | + } | ||
19 | + } else { | ||
20 | + print "ERROR: \$utils::PATH_TO_MAILQ is not defined\n"; | ||
21 | + exit $ERRORS{'UNKNOWN'}; | ||
22 | + } | ||
23 | |||
24 | - | ||
25 | + while (<MAILQ>) { | ||
26 | + #22m 1.7K 19aEEr-0007hx-Dy <> *** frozen *** | ||
27 | + #root@exlixams.glups.fr | ||
28 | + | ||
29 | + if (/\s[\w\d]{6}-[\w\d]{6}-[\w\d]{2}\s/) { # message id 19aEEr-0007hx-Dy | ||
30 | + $msg_q++ ; | ||
31 | + } | ||
32 | + } | ||
33 | + close(MAILQ) ; | ||
34 | + if ($msg_q < $opt_w) { | ||
35 | + $msg = "OK: mailq ($msg_q) is below threshold ($opt_w/$opt_c)"; | ||
36 | + $state = $ERRORS{'OK'}; | ||
37 | + }elsif ($msg_q >= $opt_w && $msg_q < $opt_c) { | ||
38 | + $msg = "WARNING: mailq is $msg_q (threshold w = $opt_w)"; | ||
39 | + $state = $ERRORS{'WARNING'}; | ||
40 | + }else { | ||
41 | + $msg = "CRITICAL: mailq is $msg_q (threshold c = $opt_c)"; | ||
42 | + $state = $ERRORS{'CRITICAL'}; | ||
43 | + } | ||
44 | +} # end of ($mailq eq "exim") | ||
45 | |||
46 | # Perfdata support | ||
47 | print "$msg |mailq=$msg_q\n"; | ||
48 | @@ -526,7 +561,7 @@ | ||
49 | } | ||
50 | |||
51 | if (defined $opt_M) { | ||
52 | - if ($opt_M =~ /sendmail/ || $opt_M =~ /qmail/ || $opt_M =~ /postfix/ ) { | ||
53 | + if ($opt_M =~ /sendmail|qmail|postfix|exim/) { | ||
54 | $mailq = $opt_M ; | ||
55 | }elsif( $opt_M eq ''){ | ||
56 | $mailq = 'sendmail'; | ||
57 | @@ -558,7 +593,7 @@ | ||
58 | print "-W (--Warning) = Min. number of messages for same domain in queue to generate warning\n"; | ||
59 | print "-C (--Critical) = Min. number of messages for same domain in queue to generate critical alert ( W < C )\n"; | ||
60 | print "-t (--timeout) = Plugin timeout in seconds (default = $utils::TIMEOUT)\n"; | ||
61 | - print "-M (--mailserver) = [ sendmail | qmail | postfix ] (default = sendmail)\n"; | ||
62 | + print "-M (--mailserver) = [ sendmail | qmail | postfix | exim ] (default = sendmail)\n"; | ||
63 | print "-h (--help)\n"; | ||
64 | print "-V (--version)\n"; | ||
65 | print "-v (--verbose) = debugging output\n"; | ||