summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xplugins-scripts/check_mailq.pl34
1 files changed, 17 insertions, 17 deletions
diff --git a/plugins-scripts/check_mailq.pl b/plugins-scripts/check_mailq.pl
index 2cb54b6..8293e9c 100755
--- a/plugins-scripts/check_mailq.pl
+++ b/plugins-scripts/check_mailq.pl
@@ -199,20 +199,20 @@ if ($mailq eq "sendmail") {
199 ## now check the queue length(s) 199 ## now check the queue length(s)
200 200
201 if ($msg_q == 0) { 201 if ($msg_q == 0) {
202 $msg = "OK: mailq is empty"; 202 $msg = "OK: $mailq mailq is empty";
203 $state = $ERRORS{'OK'}; 203 $state = $ERRORS{'OK'};
204 } else { 204 } else {
205 print "msg_q = $msg_q warn=$opt_w crit=$opt_c\n" if $verbose; 205 print "msg_q = $msg_q warn=$opt_w crit=$opt_c\n" if $verbose;
206 206
207 # overall queue length 207 # overall queue length
208 if ($msg_q < $opt_w) { 208 if ($msg_q < $opt_w) {
209 $msg = "OK: mailq ($msg_q) is below threshold ($opt_w/$opt_c)"; 209 $msg = "OK: $mailq mailq ($msg_q) is below threshold ($opt_w/$opt_c)";
210 $state = $ERRORS{'OK'}; 210 $state = $ERRORS{'OK'};
211 }elsif ($msg_q >= $opt_w && $msg_q < $opt_c) { 211 }elsif ($msg_q >= $opt_w && $msg_q < $opt_c) {
212 $msg = "WARNING: mailq is $msg_q (threshold w = $opt_w)"; 212 $msg = "WARNING: $mailq mailq is $msg_q (threshold w = $opt_w)";
213 $state = $ERRORS{'WARNING'}; 213 $state = $ERRORS{'WARNING'};
214 }else { 214 }else {
215 $msg = "CRITICAL: mailq is $msg_q (threshold c = $opt_c)"; 215 $msg = "CRITICAL: $mailq mailq is $msg_q (threshold c = $opt_c)";
216 $state = $ERRORS{'CRITICAL'}; 216 $state = $ERRORS{'CRITICAL'};
217 } 217 }
218 218
@@ -344,20 +344,20 @@ elsif ( $mailq eq "postfix" ) {
344 344
345 # check queue length(s) 345 # check queue length(s)
346 if ($msg_q == 0){ 346 if ($msg_q == 0){
347 $msg = "OK: mailq reports queue is empty"; 347 $msg = "OK: $mailq mailq reports queue is empty";
348 $state = $ERRORS{'OK'}; 348 $state = $ERRORS{'OK'};
349 } else { 349 } else {
350 print "msg_q = $msg_q warn=$opt_w crit=$opt_c\n" if $verbose; 350 print "msg_q = $msg_q warn=$opt_w crit=$opt_c\n" if $verbose;
351 351
352 # overall queue length 352 # overall queue length
353 if ($msg_q < $opt_w) { 353 if ($msg_q < $opt_w) {
354 $msg = "OK: mailq ($msg_q) is below threshold ($opt_w/$opt_c)"; 354 $msg = "OK: $mailq mailq ($msg_q) is below threshold ($opt_w/$opt_c)";
355 $state = $ERRORS{'OK'}; 355 $state = $ERRORS{'OK'};
356 }elsif ($msg_q >= $opt_w && $msg_q < $opt_c) { 356 }elsif ($msg_q >= $opt_w && $msg_q < $opt_c) {
357 $msg = "WARNING: mailq is $msg_q (threshold w = $opt_w)"; 357 $msg = "WARNING: $mailq mailq is $msg_q (threshold w = $opt_w)";
358 $state = $ERRORS{'WARNING'}; 358 $state = $ERRORS{'WARNING'};
359 }else { 359 }else {
360 $msg = "CRITICAL: mailq is $msg_q (threshold c = $opt_c)"; 360 $msg = "CRITICAL: $mailq mailq is $msg_q (threshold c = $opt_c)";
361 $state = $ERRORS{'CRITICAL'}; 361 $state = $ERRORS{'CRITICAL'};
362 } 362 }
363 363
@@ -431,13 +431,13 @@ elsif ( $mailq eq "qmail" ) {
431 431
432 # overall queue length 432 # overall queue length
433 if ($msg_q < $opt_w) { 433 if ($msg_q < $opt_w) {
434 $msg = "OK: mailq ($msg_q) is below threshold ($opt_w/$opt_c)"; 434 $msg = "OK: $mailq mailq ($msg_q) is below threshold ($opt_w/$opt_c)";
435 $state = $ERRORS{'OK'}; 435 $state = $ERRORS{'OK'};
436 }elsif ($msg_q >= $opt_w && $msg_q < $opt_c) { 436 }elsif ($msg_q >= $opt_w && $msg_q < $opt_c) {
437 $msg = "WARNING: mailq is $msg_q (threshold w = $opt_w)"; 437 $msg = "WARNING: $mailq mailq is $msg_q (threshold w = $opt_w)";
438 $state = $ERRORS{'WARNING'}; 438 $state = $ERRORS{'WARNING'};
439 }else { 439 }else {
440 $msg = "CRITICAL: mailq is $msg_q (threshold c = $opt_c)"; 440 $msg = "CRITICAL: $mailq mailq is $msg_q (threshold c = $opt_c)";
441 $state = $ERRORS{'CRITICAL'}; 441 $state = $ERRORS{'CRITICAL'};
442 } 442 }
443 443
@@ -489,13 +489,13 @@ elsif ( $mailq eq "exim" ) {
489 exit $ERRORS{CRITICAL}; 489 exit $ERRORS{CRITICAL};
490 } 490 }
491 if ($msg_q < $opt_w) { 491 if ($msg_q < $opt_w) {
492 $msg = "OK: mailq ($msg_q) is below threshold ($opt_w/$opt_c)"; 492 $msg = "OK: $mailq mailq ($msg_q) is below threshold ($opt_w/$opt_c)";
493 $state = $ERRORS{'OK'}; 493 $state = $ERRORS{'OK'};
494 }elsif ($msg_q >= $opt_w && $msg_q < $opt_c) { 494 }elsif ($msg_q >= $opt_w && $msg_q < $opt_c) {
495 $msg = "WARNING: mailq is $msg_q (threshold w = $opt_w)"; 495 $msg = "WARNING: $mailq mailq is $msg_q (threshold w = $opt_w)";
496 $state = $ERRORS{'WARNING'}; 496 $state = $ERRORS{'WARNING'};
497 }else { 497 }else {
498 $msg = "CRITICAL: mailq is $msg_q (threshold c = $opt_c)"; 498 $msg = "CRITICAL: $mailq mailq is $msg_q (threshold c = $opt_c)";
499 $state = $ERRORS{'CRITICAL'}; 499 $state = $ERRORS{'CRITICAL'};
500 } 500 }
501} # end of ($mailq eq "exim") 501} # end of ($mailq eq "exim")
@@ -526,13 +526,13 @@ elsif ( $mailq eq "nullmailer" ) {
526 } 526 }
527 close(MAILQ) ; 527 close(MAILQ) ;
528 if ($msg_q < $opt_w) { 528 if ($msg_q < $opt_w) {
529 $msg = "OK: mailq ($msg_q) is below threshold ($opt_w/$opt_c)"; 529 $msg = "OK: $mailq mailq ($msg_q) is below threshold ($opt_w/$opt_c)";
530 $state = $ERRORS{'OK'}; 530 $state = $ERRORS{'OK'};
531 }elsif ($msg_q >= $opt_w && $msg_q < $opt_c) { 531 }elsif ($msg_q >= $opt_w && $msg_q < $opt_c) {
532 $msg = "WARNING: mailq is $msg_q (threshold w = $opt_w)"; 532 $msg = "WARNING: $mailq mailq is $msg_q (threshold w = $opt_w)";
533 $state = $ERRORS{'WARNING'}; 533 $state = $ERRORS{'WARNING'};
534 }else { 534 }else {
535 $msg = "CRITICAL: mailq is $msg_q (threshold c = $opt_c)"; 535 $msg = "CRITICAL: $mailq mailq is $msg_q (threshold c = $opt_c)";
536 $state = $ERRORS{'CRITICAL'}; 536 $state = $ERRORS{'CRITICAL'};
537 } 537 }
538} # end of ($mailq eq "nullmailer") 538} # end of ($mailq eq "nullmailer")