FreeBSD Bugzilla – Attachment 186294 Details for
Bug 222237
net-mgmt/monitoring-plugins: Extend the mailq to support opensmtp
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch regarding to the review [adds opensmtp support]
patch_adds_opensmtp_D12322.diff (text/plain), 1.82 KB, created by
Mahdi Mokhtari
on 2017-09-12 11:29:17 UTC
(
hide
)
Description:
Patch regarding to the review [adds opensmtp support]
Filename:
MIME Type:
Creator:
Mahdi Mokhtari
Created:
2017-09-12 11:29:17 UTC
Size:
1.82 KB
patch
obsolete
>Index: net-mgmt/monitoring-plugins/files/patch-plugins-scripts_check_mailq.pl >=================================================================== >--- /dev/null >+++ net-mgmt/monitoring-plugins/files/patch-plugins-scripts_check_mailq.pl >@@ -0,0 +1,51 @@ >+--- plugins-scripts/check_mailq.pl.orig 2017-09-11 16:12:55 UTC >++++ plugins-scripts/check_mailq.pl >+@@ -550,6 +550,39 @@ >+ } >+ } # end of ($mailq eq "nullmailer") >+ >++elsif ( $mailq eq "opensmtp" ) { >++ ## open mailq >++ if ( defined $utils::PATH_TO_MAILQ && -x $utils::PATH_TO_MAILQ ) { >++ if (! open (MAILQ, "$sudo $utils::PATH_TO_MAILQ | " ) ) { >++ print "ERROR: could not open $utils::PATH_TO_MAILQ \n"; >++ exit $ERRORS{'UNKNOWN'}; >++ } >++ }elsif( defined $utils::PATH_TO_MAILQ){ >++ unless (-x $utils::PATH_TO_MAILQ) { >++ print "ERROR: $utils::PATH_TO_MAILQ is not executable by (uid $>:gid($)))\n"; >++ exit $ERRORS{'UNKNOWN'}; >++ } >++ } else { >++ print "ERROR: \$utils::PATH_TO_MAILQ is not defined\n"; >++ exit $ERRORS{'UNKNOWN'}; >++ } >++ >++ $msg_q++ while (<MAILQ>); >++ >++ close(MAILQ) ; >++ if ($msg_q < $opt_w) { >++ $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 mailq is $msg_q (threshold w = $opt_w)"; >++ $state = $ERRORS{'WARNING'}; >++ }else { >++ $msg = "CRITICAL: $mailq mailq is $msg_q (threshold c = $opt_c)"; >++ $state = $ERRORS{'CRITICAL'}; >++ } >++} # end of ($mailq eq "opensmtp") >++ >++ >+ # Perfdata support >+ print "$msg|unsent=$msg_q;$opt_w;$opt_c;0\n"; >+ exit $state; >+@@ -610,7 +643,7 @@ () >+ } >+ >+ if (defined $opt_M) { >+- if ($opt_M =~ /^(sendmail|qmail|postfix|exim|nullmailer)$/) { >++ if ($opt_M =~ /^(sendmail|qmail|postfix|exim|nullmailer|opensmtp)$/) { >+ $mailq = $opt_M ; >+ }elsif( $opt_M eq ''){ >+ $mailq = 'sendmail';
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 222237
: 186294