瀏覽代碼

Handle "mailq: Mail queue is empty" for Postfix

Gennady Utkin 4 年之前
父節點
當前提交
34f99fe07f
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      plugins-scripts/check_mailq.pl

+ 2 - 2
plugins-scripts/check_mailq.pl

@@ -319,14 +319,14 @@ elsif ( $mailq eq "postfix" ) {
      ## open mailq
 	if ( defined $utils::PATH_TO_MAILQ ) {
 		if (-x $utils::PATH_TO_MAILQ) {
-			if (! open (MAILQ, "$utils::PATH_TO_MAILQ$mailq_args | ")) {
+			if (! open (MAILQ, "$utils::PATH_TO_MAILQ$mailq_args 2>&1 | ")) {
 				print "ERROR: $utils::PATH_TO_MAILQ$mailq_args returned an error\n";
 				exit $ERRORS{'UNKNOWN'};
 			}
 		}
 		else {
 			if ( $sudo ne "" ) {
-				if (! open (MAILQ, "$sudo $utils::PATH_TO_MAILQ$mailq_args | " ) ) {
+				if (! open (MAILQ, "$sudo $utils::PATH_TO_MAILQ$mailq_args 2>&1 | " ) ) {
 					print "ERROR: $utils::PATH_TO_MAILQ$mailq_args is not executable with sudo by (uid $>:gid($)))\n";
 					exit $ERRORS{'UNKNOWN'};
 				}