From owner-svn-ports-head@FreeBSD.ORG Thu Nov 20 13:18:44 2014 Return-Path: Delivered-To: svn-ports-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2F5F67AB; Thu, 20 Nov 2014 13:18:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 1B5EA858; Thu, 20 Nov 2014 13:18:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAKDIhMS004297; Thu, 20 Nov 2014 13:18:43 GMT (envelope-from mat@FreeBSD.org) Received: (from mat@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAKDIhn1004249; Thu, 20 Nov 2014 13:18:43 GMT (envelope-from mat@FreeBSD.org) Message-Id: <201411201318.sAKDIhn1004249@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mat set sender to mat@FreeBSD.org using -f From: Mathieu Arnold Date: Thu, 20 Nov 2014 13:18:43 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r372917 - in head/sysutils/munin-node: . files X-SVN-Group: ports-head 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.18-1 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, 20 Nov 2014 13:18:44 -0000 Author: mat Date: Thu Nov 20 13:18:42 2014 New Revision: 372917 URL: https://svnweb.freebsd.org/changeset/ports/372917 QAT: https://qat.redports.org/buildarchive/r372917/ Log: Fix nutups_*. PR: 195196 Submitted by: jeffrey endrift com Sponsored by: Absolight Added: head/sysutils/munin-node/files/patch-plugins_node.d_nutups__.in (contents, props changed) Modified: head/sysutils/munin-node/Makefile head/sysutils/munin-node/files/plugins.conf.in Modified: head/sysutils/munin-node/Makefile ============================================================================== --- head/sysutils/munin-node/Makefile Thu Nov 20 13:12:57 2014 (r372916) +++ head/sysutils/munin-node/Makefile Thu Nov 20 13:18:42 2014 (r372917) @@ -3,7 +3,7 @@ PORTNAME= munin PORTVERSION= ${MUNIN_VERSION} -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= sysutils perl5 MASTER_SITES= ${MUNIN_SITES} PKGNAMESUFFIX= -node Added: head/sysutils/munin-node/files/patch-plugins_node.d_nutups__.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/munin-node/files/patch-plugins_node.d_nutups__.in Thu Nov 20 13:18:42 2014 (r372917) @@ -0,0 +1,67 @@ +--- plugins/node.d/nutups_.in.orig 2014-10-26 14:12:24 UTC ++++ plugins/node.d/nutups_.in +@@ -7,20 +7,25 @@ + # + # usage: ups_upsid_function + # ++# env.upsc (default: "/bin/upsc") ++# env.upsconf (default: "/etc/nut/ups.conf") ++# + #%# family=contrib + #%# capabilities=autoconf suggest + + UPS=$(basename $0 | cut -d_ -f2) + FUNCTION=$(basename $0 | cut -d_ -f3) ++UPSC=${upsc:-/bin/upsc} ++UPSCONF=${upsconf:-/etc/nut/ups.conf} + + if [ "$1" = "autoconf" ]; then +- [ -x /bin/upsc ] && [ -r /etc/nut/ups.conf ] && echo yes && exit 0 +- echo "no (/bin/upsc or /etc/nut/ups.conf not found)" ++ [ -x $UPSC ] && [ -r $UPSCONF ] && echo yes && exit 0 ++ echo "no ($UPSC or $UPSCONF not found)" + exit 0 + fi + + if [ "$1" = "suggest" ]; then +- grep '^\[[^]]*\]$' /etc/nut/ups.conf \ ++ grep '^\[[^]]*\]$' $UPSCONF \ + | tr -d '][' \ + | while read ups; do + for i in voltages freq charge current; do +@@ -42,7 +47,7 @@ voltages() { + echo "${i}.min 0" + done + else +- upsc $UPS | sed -n '/volt/{ ++ $UPSC $UPS | sed -n '/volt/{ + s/:// + /nominal/s/.* /nominal.value / + /voltage/s/\.[^ ]*/.value/ +@@ -64,7 +69,7 @@ charge() { + echo "${i}.min 0" + done + else +- upsc $UPS | sed -n '/charge/{ ++ $UPSC $UPS | sed -n '/charge/{ + s/^[^:]*\.//g + s/:/.value/ + p +@@ -87,7 +92,7 @@ frequency() { + echo "acfreq.max 100" + echo "acfreq.min 5" + else +- upsc $UPS | sed -n '/freq/{s/.*:/acfreq.value/;p}' ++ $UPSC $UPS | sed -n '/freq/{s/.*:/acfreq.value/;p}' + fi + } + +@@ -102,7 +107,7 @@ current() { + echo "current.max 100" + echo "current.min 0" + else +- upsc $UPS | sed -n '/current/{s/.*:/current.value/;p}' ++ $UPSC $UPS | sed -n '/current/{s/.*:/current.value/;p}' + fi + } + Modified: head/sysutils/munin-node/files/plugins.conf.in ============================================================================== --- head/sysutils/munin-node/files/plugins.conf.in Thu Nov 20 13:12:57 2014 (r372916) +++ head/sysutils/munin-node/files/plugins.conf.in Thu Nov 20 13:18:42 2014 (r372917) @@ -62,3 +62,7 @@ env.mailstats /usr/sbin/mailstats [fail2ban*] user root env.client %%LOCALBASE%%/bin/fail2ban-client + +[nut*] +env.upsc %%LOCALBASE%%/bin/upsc +env.upsconf %%LOCALBASE%%/etc/nut/ups.conf"