diff options
author | Mathieu Arnold <mat@FreeBSD.org> | 2014-11-20 13:18:42 +0000 |
---|---|---|
committer | Mathieu Arnold <mat@FreeBSD.org> | 2014-11-20 13:18:42 +0000 |
commit | bc01935d263e75d856e5808f37af225444dc6bb4 (patch) | |
tree | dec46e3d21af4d6e0ef1f8f2bc718e6609fc0368 /sysutils/munin-node | |
parent | 7564a4401d00b79aceee306ff5d1e9669278d7c1 (diff) | |
download | ports-bc01935d263e75d856e5808f37af225444dc6bb4.tar.gz ports-bc01935d263e75d856e5808f37af225444dc6bb4.zip |
Notes
Diffstat (limited to 'sysutils/munin-node')
-rw-r--r-- | sysutils/munin-node/Makefile | 2 | ||||
-rw-r--r-- | sysutils/munin-node/files/patch-plugins_node.d_nutups__.in | 67 | ||||
-rw-r--r-- | sysutils/munin-node/files/plugins.conf.in | 4 |
3 files changed, 72 insertions, 1 deletions
diff --git a/sysutils/munin-node/Makefile b/sysutils/munin-node/Makefile index 9ccf8ce619d0..de7bd6dce2f3 100644 --- a/sysutils/munin-node/Makefile +++ b/sysutils/munin-node/Makefile @@ -3,7 +3,7 @@ PORTNAME= munin PORTVERSION= ${MUNIN_VERSION} -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= sysutils perl5 MASTER_SITES= ${MUNIN_SITES} PKGNAMESUFFIX= -node diff --git a/sysutils/munin-node/files/patch-plugins_node.d_nutups__.in b/sysutils/munin-node/files/patch-plugins_node.d_nutups__.in new file mode 100644 index 000000000000..d4b462827632 --- /dev/null +++ b/sysutils/munin-node/files/patch-plugins_node.d_nutups__.in @@ -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 <command> (default: "/bin/upsc") ++# env.upsconf <filename> (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 + } + diff --git a/sysutils/munin-node/files/plugins.conf.in b/sysutils/munin-node/files/plugins.conf.in index d9b76a6516a0..8d48e85bf685 100644 --- a/sysutils/munin-node/files/plugins.conf.in +++ b/sysutils/munin-node/files/plugins.conf.in @@ -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" |