diff options
author | Evgeni Golov <evgeni@golov.de> | 2014-02-27 19:25:14 +0100 |
---|---|---|
committer | Jan Wagner <waja@cyconet.org> | 2014-02-27 20:44:58 +0100 |
commit | 1988e49fcecd5a502b2a6d32c212e28b17bb6d9c (patch) | |
tree | 0a232fb1beb7d844a2c47ff1bb992593baba3439 /plugins-scripts/check_mailq.pl | |
parent | f14ae4b99a9835edf6aa3c39c2949cdd056dcee2 (diff) | |
download | monitoring-plugins-1988e49fcecd5a502b2a6d32c212e28b17bb6d9c.tar.gz |
check_mailq: add $mailq to check output, so it is easily visible what was autodetected
Closes: #1242
Diffstat (limited to 'plugins-scripts/check_mailq.pl')
-rwxr-xr-x | plugins-scripts/check_mailq.pl | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/plugins-scripts/check_mailq.pl b/plugins-scripts/check_mailq.pl index 2cb54b63..8293e9c6 100755 --- a/plugins-scripts/check_mailq.pl +++ b/plugins-scripts/check_mailq.pl @@ -199,20 +199,20 @@ if ($mailq eq "sendmail") { ## now check the queue length(s) if ($msg_q == 0) { - $msg = "OK: mailq is empty"; + $msg = "OK: $mailq mailq is empty"; $state = $ERRORS{'OK'}; } else { print "msg_q = $msg_q warn=$opt_w crit=$opt_c\n" if $verbose; # overall queue length if ($msg_q < $opt_w) { - $msg = "OK: mailq ($msg_q) is below threshold ($opt_w/$opt_c)"; + $msg = "OK: $mailq 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)"; + $msg = "WARNING: $mailq mailq is $msg_q (threshold w = $opt_w)"; $state = $ERRORS{'WARNING'}; }else { - $msg = "CRITICAL: mailq is $msg_q (threshold c = $opt_c)"; + $msg = "CRITICAL: $mailq mailq is $msg_q (threshold c = $opt_c)"; $state = $ERRORS{'CRITICAL'}; } @@ -344,20 +344,20 @@ elsif ( $mailq eq "postfix" ) { # check queue length(s) if ($msg_q == 0){ - $msg = "OK: mailq reports queue is empty"; + $msg = "OK: $mailq mailq reports queue is empty"; $state = $ERRORS{'OK'}; } else { print "msg_q = $msg_q warn=$opt_w crit=$opt_c\n" if $verbose; # overall queue length if ($msg_q < $opt_w) { - $msg = "OK: mailq ($msg_q) is below threshold ($opt_w/$opt_c)"; + $msg = "OK: $mailq 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)"; + $msg = "WARNING: $mailq mailq is $msg_q (threshold w = $opt_w)"; $state = $ERRORS{'WARNING'}; }else { - $msg = "CRITICAL: mailq is $msg_q (threshold c = $opt_c)"; + $msg = "CRITICAL: $mailq mailq is $msg_q (threshold c = $opt_c)"; $state = $ERRORS{'CRITICAL'}; } @@ -431,13 +431,13 @@ elsif ( $mailq eq "qmail" ) { # overall queue length if ($msg_q < $opt_w) { - $msg = "OK: mailq ($msg_q) is below threshold ($opt_w/$opt_c)"; + $msg = "OK: $mailq 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)"; + $msg = "WARNING: $mailq mailq is $msg_q (threshold w = $opt_w)"; $state = $ERRORS{'WARNING'}; }else { - $msg = "CRITICAL: mailq is $msg_q (threshold c = $opt_c)"; + $msg = "CRITICAL: $mailq mailq is $msg_q (threshold c = $opt_c)"; $state = $ERRORS{'CRITICAL'}; } @@ -489,13 +489,13 @@ elsif ( $mailq eq "exim" ) { exit $ERRORS{CRITICAL}; } if ($msg_q < $opt_w) { - $msg = "OK: mailq ($msg_q) is below threshold ($opt_w/$opt_c)"; + $msg = "OK: $mailq 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)"; + $msg = "WARNING: $mailq mailq is $msg_q (threshold w = $opt_w)"; $state = $ERRORS{'WARNING'}; }else { - $msg = "CRITICAL: mailq is $msg_q (threshold c = $opt_c)"; + $msg = "CRITICAL: $mailq mailq is $msg_q (threshold c = $opt_c)"; $state = $ERRORS{'CRITICAL'}; } } # end of ($mailq eq "exim") @@ -526,13 +526,13 @@ elsif ( $mailq eq "nullmailer" ) { } close(MAILQ) ; if ($msg_q < $opt_w) { - $msg = "OK: mailq ($msg_q) is below threshold ($opt_w/$opt_c)"; + $msg = "OK: $mailq 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)"; + $msg = "WARNING: $mailq mailq is $msg_q (threshold w = $opt_w)"; $state = $ERRORS{'WARNING'}; }else { - $msg = "CRITICAL: mailq is $msg_q (threshold c = $opt_c)"; + $msg = "CRITICAL: $mailq mailq is $msg_q (threshold c = $opt_c)"; $state = $ERRORS{'CRITICAL'}; } } # end of ($mailq eq "nullmailer") |