nagiosでmailqのチェックをしようとしたらうまく動いてなかったので、
こんなパッチを当てると良いです。
怖いのはデフォルトのままで使うとどんなときもmailq emptyを返すので、まったくチェックにならないです。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# diff -u ./check_mailq.org /usr/lib/nagios/plugins/check_mailq | |
--- ./check_mailq.org 2013-04-08 17:33:52.000000000 +0900 | |
+++ /usr/lib/nagios/plugins/check_mailq 2013-04-08 17:34:03.000000000 +0900 | |
@@ -165,9 +165,9 @@ | |
# Finally look at the overall queue length | |
# | |
- if (/mqueue/) { | |
+ if (/^\-\-/) { | |
print "$utils::PATH_TO_MAILQ = $_ "if $verbose ; | |
- if (/ \((\d+) request/) { | |
+ if (/ (\d+) Request/) { | |
# | |
# single queue: first line | |
# multi queue: one for each queue. overwrite on multi queue below |
zimbraのmailqをチェックする場合はこんな感じ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# diff -u check_mailq.org /usr/lib/nagios/plugins/check_mailq | |
--- check_mailq.org 2013-04-09 10:22:53.701747418 +0900 | |
+++ /usr/lib/nagios/plugins/check_mailq 2013-04-09 10:26:15.281747415 +0900 | |
@@ -47,6 +47,7 @@ | |
$msg_q = 0 ; | |
$msg_p = 0 ; | |
$state = $ERRORS{'UNKNOWN'}; | |
+$utils::PATH_TO_MAILQ = "/opt/zimbra/postfix/sbin/mailq"; | |
Getopt::Long::Configure('bundling'); | |
$status = process_arguments(); | |
@@ -164,9 +165,9 @@ | |
# Finally look at the overall queue length | |
# | |
- if (/mqueue/) { | |
+ if (/^\-\-/) { | |
print "$utils::PATH_TO_MAILQ = $_ "if $verbose ; | |
- if (/ \((\d+) request/) { | |
+ if (/ (\d+) Request/) { | |
# | |
# single queue: first line | |
# multi queue: one for each queue. overwrite on multi queue below |