summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4240aba)
raw | patch | inline | side by side (parent: 4240aba)
author | Ton Voon <tonvoon@users.sourceforge.net> | |
Wed, 5 Jul 2006 13:45:57 +0000 (13:45 +0000) | ||
committer | Ton Voon <tonvoon@users.sourceforge.net> | |
Wed, 5 Jul 2006 13:45:57 +0000 (13:45 +0000) |
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1443 f882894a-f735-0410-b71e-b25c423dba1c
plugins-scripts/check_mailq.pl | patch | blob | history |
index f1aec0f400152b8e828403231376ac91a88ffdf9..c676e41a1ac6a3b78d2447d90a1ad427dcf02dbf 100755 (executable)
## close mailq
close (MAILQ);
- # declare an error if we also get a non-zero return code from mailq
- # unless already set to critical
+
if ( $? ) {
- $state = $state == $ERRORS{"CRITICAL"} ? $ERRORS{"CRITICAL"} : $ERRORS{"WARNING"} ;
- print "STDERR $?: $!\n" if $verbose;
- $msg = "$state: (stderr)\n";
+ print "CRITICAL: Error code ".($?>>8)." returned from $utils::PATH_TO_MAILQ",$/;
+ exit $ERRORS{CRITICAL};
}
## shut off the alarm
# close qmail-qstat
close MAILQ;
- # declare an error if we also get a non-zero return code from mailq
- # unless already set to critical
+
if ( $? ) {
- $state = $state == $ERRORS{"CRITICAL"} ? $ERRORS{"CRITICAL"} : $ERRORS{"WARNING"} ;
- print "STDERR $?: $!\n" if $verbose;
- $msg = "$state: (stderr)\n";
+ print "CRITICAL: Error code ".($?>>8)." returned from $utils::PATH_TO_MAILQ",$/;
+ exit $ERRORS{CRITICAL};
}
## shut off the alarm
# close qmail-qstat
close MAILQ;
- # declare an error if we also get a non-zero return code from mailq
- # unless already set to critical
+
if ( $? ) {
- $state = $state == $ERRORS{"CRITICAL"} ? $ERRORS{"CRITICAL"} : $ERRORS{"WARNING"} ;
- print "STDERR $?: $!\n" if $verbose;
- $msg = "$state: (stderr)\n";
+ print "CRITICAL: Error code ".($?>>8)." returned from $utils::PATH_TO_MAILQ",$/;
+ exit $ERRORS{CRITICAL};
}
## shut off the alarm
}
}
close(MAILQ) ;
+
+ if ( $? ) {
+ print "CRITICAL: Error code ".($?>>8)." returned from $utils::PATH_TO_MAILQ",$/;
+ exit $ERRORS{CRITICAL};
+ }
if ($msg_q < $opt_w) {
$msg = "OK: mailq ($msg_q) is below threshold ($opt_w/$opt_c)";
$state = $ERRORS{'OK'};