From owner-svn-ports-head@freebsd.org Thu Sep 14 11:58:59 2017 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9610E12B1D; Thu, 14 Sep 2017 11:58:59 +0000 (UTC) (envelope-from mat@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7FE75711FC; Thu, 14 Sep 2017 11:58:59 +0000 (UTC) (envelope-from mat@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8EBwwbP084773; Thu, 14 Sep 2017 11:58:58 GMT (envelope-from mat@FreeBSD.org) Received: (from mat@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8EBwwOJ084769; Thu, 14 Sep 2017 11:58:58 GMT (envelope-from mat@FreeBSD.org) Message-Id: <201709141158.v8EBwwOJ084769@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mat set sender to mat@FreeBSD.org using -f From: Mathieu Arnold Date: Thu, 14 Sep 2017 11:58:58 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r449835 - in head/net-mgmt: monitoring-plugins monitoring-plugins/files nagios-plugins nagios-plugins/files X-SVN-Group: ports-head X-SVN-Commit-Author: mat X-SVN-Commit-Paths: in head/net-mgmt: monitoring-plugins monitoring-plugins/files nagios-plugins nagios-plugins/files X-SVN-Commit-Revision: 449835 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Sep 2017 11:58:59 -0000 Author: mat Date: Thu Sep 14 11:58:58 2017 New Revision: 449835 URL: https://svnweb.freebsd.org/changeset/ports/449835 Log: Add support for opensmtp in check_mailq. PR: 222237 Submitted by: mmokhi Obtained from: https://github.com/nagios-plugins/nagios-plugins/commit/d56818f5121b05439c7b7a1655d96ab39e066797 Obtained from: https://github.com/monitoring-plugins/monitoring-plugins/pull/1495 Sponsored by: Absolight Added: head/net-mgmt/monitoring-plugins/files/patch-plugins-scripts_check__mailq.pl (contents, props changed) head/net-mgmt/nagios-plugins/files/patch-plugins-scripts_check__mailq.pl (contents, props changed) Modified: head/net-mgmt/monitoring-plugins/Makefile (contents, props changed) head/net-mgmt/nagios-plugins/Makefile (contents, props changed) Modified: head/net-mgmt/monitoring-plugins/Makefile ============================================================================== --- head/net-mgmt/monitoring-plugins/Makefile Thu Sep 14 11:25:39 2017 (r449834) +++ head/net-mgmt/monitoring-plugins/Makefile Thu Sep 14 11:58:58 2017 (r449835) @@ -3,7 +3,7 @@ PORTNAME= monitoring-plugins PORTVERSION= 2.2 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= net-mgmt MASTER_SITES= https://www.monitoring-plugins.org/download/ LOCAL/mat/${PORTNAME} Added: head/net-mgmt/monitoring-plugins/files/patch-plugins-scripts_check__mailq.pl ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net-mgmt/monitoring-plugins/files/patch-plugins-scripts_check__mailq.pl Thu Sep 14 11:58:58 2017 (r449835) @@ -0,0 +1,56 @@ +From 94acff9f2616fbca8fd31292d374d9ce8a45263a Mon Sep 17 00:00:00 2001 +From: Filias Heidt +Date: Fri, 9 Jun 2017 14:46:00 +0200 +Subject: [PATCH] add support for opensmtpd + +--- plugins-scripts/check_mailq.pl.orig 2016-11-29 08:45:08 UTC ++++ plugins-scripts/check_mailq.pl +@@ -550,6 +550,39 @@ elsif ( $mailq eq "nullmailer" ) { + } + } # 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 (); ++ ++ 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 @@ sub process_arguments(){ + } + + 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'; Modified: head/net-mgmt/nagios-plugins/Makefile ============================================================================== --- head/net-mgmt/nagios-plugins/Makefile Thu Sep 14 11:25:39 2017 (r449834) +++ head/net-mgmt/nagios-plugins/Makefile Thu Sep 14 11:58:58 2017 (r449835) @@ -3,7 +3,7 @@ PORTNAME= nagios-plugins PORTVERSION= 2.2.1 -PORTREVISION= 4 +PORTREVISION= 5 PORTEPOCH= 1 CATEGORIES= net-mgmt MASTER_SITES= https://www.nagios-plugins.org/download/ \ Added: head/net-mgmt/nagios-plugins/files/patch-plugins-scripts_check__mailq.pl ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net-mgmt/nagios-plugins/files/patch-plugins-scripts_check__mailq.pl Thu Sep 14 11:58:58 2017 (r449835) @@ -0,0 +1,57 @@ +commit d56818f5121b05439c7b7a1655d96ab39e066797 +Author: Filias Heidt +Date: 2017-04-24 11:00:43 +0200 + + add support for opensmtpd + +--- plugins-scripts/check_mailq.pl.orig 2017-04-19 16:03:12 UTC ++++ plugins-scripts/check_mailq.pl +@@ -558,6 +558,39 @@ elsif ( $mailq eq "nullmailer" ) { + } + } # 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 (); ++ ++ 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; +@@ -618,7 +651,7 @@ sub process_arguments(){ + } + + 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';