summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5436e67)
raw | patch | inline | side by side (parent: 5436e67)
author | Ton Voon <tonvoon@users.sourceforge.net> | |
Mon, 15 Sep 2003 15:28:35 +0000 (15:28 +0000) | ||
committer | Ton Voon <tonvoon@users.sourceforge.net> | |
Mon, 15 Sep 2003 15:28:35 +0000 (15:28 +0000) |
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@726 f882894a-f735-0410-b71e-b25c423dba1c
AUTHORS | patch | blob | history | |
plugins-scripts/check_mailq.pl | patch | blob | history |
index f50d0e79d940659feaacd34f5e79ba572951cd91..afd3ad63afdc440b4507980f9f83d7a2cf01cebc 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
Richard Brodie
Patrick Allen
Steve Hanselman
+Eric Bollengier
index 0505207b04e6ffd115e19fd2b13f8e70552e5e1b..aaec2515c8379b8e1646600c17bd21f2fe999eb7 100755 (executable)
} # end of ($mailq eq "qmail")
+elsif ( $mailq eq "exim" ) {
+ ## open mailq
+ if ( defined $utils::PATH_TO_MAILQ && -x $utils::PATH_TO_MAILQ ) {
+ if (! open (MAILQ, "$utils::PATH_TO_MAILQ | " ) ) {
+ print "ERROR: could not open $utils::PATH_TO_MAILQ \n";
+ exit $ERRORS{'UNKNOWN'};
+ }
+ }elsif( defined $utils::PATH_TO_MAILQ){
+ unless (-x $utils::PATH_TO_MAILQ) {
+ print "ERROR: $utils::PATH_TO_MAILQ is not executable by (uid $>:gid($)))\n";
+ exit $ERRORS{'UNKNOWN'};
+ }
+ } else {
+ print "ERROR: \$utils::PATH_TO_MAILQ is not defined\n";
+ exit $ERRORS{'UNKNOWN'};
+ }
+ while (<MAILQ>) {
+ #22m 1.7K 19aEEr-0007hx-Dy <> *** frozen ***
+ #root@exlixams.glups.fr
+ if (/\s[\w\d]{6}-[\w\d]{6}-[\w\d]{2}\s/) { # message id 19aEEr-0007hx-Dy
+ $msg_q++ ;
+ }
+ }
+ close(MAILQ) ;
+ if ($msg_q < $opt_w) {
+ $msg = "OK: mailq ($msg_q) is below threshold ($opt_w/$opt_c)";
+ $state = $ERRORS{'OK'};
+ }elsif ($msg_q >= $opt_w && $msg_q < $opt_c) {
+ $msg = "WARNING: mailq is $msg_q (threshold w = $opt_w)";
+ $state = $ERRORS{'WARNING'};
+ }else {
+ $msg = "CRITICAL: mailq is $msg_q (threshold c = $opt_c)";
+ $state = $ERRORS{'CRITICAL'};
+ }
+} # end of ($mailq eq "exim")
# Perfdata support
-print "$msg |mailq=$msg_q\n";
+print "$msg|unsent=$msg_q;$opt_w;$opt_c;0\n";
exit $state;
}
if (defined $opt_M) {
- if ($opt_M =~ /sendmail/ || $opt_M =~ /qmail/ || $opt_M =~ /postfix/ ) {
+ if ($opt_M =~ /^(sendmail|qmail|postfix|exim)$/) {
$mailq = $opt_M ;
}elsif( $opt_M eq ''){
$mailq = 'sendmail';
}
sub print_usage () {
- print "Usage: $PROGNAME [-w <warn>] [-c <crit>] [-W <warn>] [-C <crit>] [-M <MTA>] [-t <timeout>] [-v verbose]\n";
+ print "Usage: $PROGNAME -w <warn> -c <crit> [-W <warn>] [-C <crit>] [-M <MTA>] [-t <timeout>] [-v verbose]\n";
}
sub print_help () {
print "-W (--Warning) = Min. number of messages for same domain in queue to generate warning\n";
print "-C (--Critical) = Min. number of messages for same domain in queue to generate critical alert ( W < C )\n";
print "-t (--timeout) = Plugin timeout in seconds (default = $utils::TIMEOUT)\n";
- print "-M (--mailserver) = [ sendmail | qmail | postfix ] (default = sendmail)\n";
+ print "-M (--mailserver) = [ sendmail | qmail | postfix | exim ] (default = sendmail)\n";
print "-h (--help)\n";
print "-V (--version)\n";
print "-v (--verbose) = debugging output\n";