diff options
author | Mathieu Arnold <mat@FreeBSD.org> | 2014-10-27 14:43:47 +0000 |
---|---|---|
committer | Mathieu Arnold <mat@FreeBSD.org> | 2014-10-27 14:43:47 +0000 |
commit | d25c9df4687de21ac0cff19f38e684d1de9180dc (patch) | |
tree | e4571394931f93e844286ccabf8e60caa4e46838 /sysutils/munin-node | |
parent | 60e8f6b3de12a8c427c78d1dfd5aed4b07c4730a (diff) | |
download | ports-d25c9df4687de21ac0cff19f38e684d1de9180dc.tar.gz ports-d25c9df4687de21ac0cff19f38e684d1de9180dc.zip |
Notes
Diffstat (limited to 'sysutils/munin-node')
5 files changed, 172 insertions, 9 deletions
diff --git a/sysutils/munin-node/Makefile b/sysutils/munin-node/Makefile index f9a10ee52366..d26e0e781b40 100644 --- a/sysutils/munin-node/Makefile +++ b/sysutils/munin-node/Makefile @@ -3,7 +3,6 @@ PORTNAME= munin PORTVERSION= ${MUNIN_VERSION} -PORTREVISION= 1 CATEGORIES= sysutils perl5 MASTER_SITES= ${MUNIN_SITES} PKGNAMESUFFIX= -node @@ -32,8 +31,6 @@ SHEBANG_FILES= node/sbin/munin-node node/sbin/munin-sched \ .include "${.CURDIR}/../munin-common/munin.mk" -DISTINFO_FILE= ${MUNIN_DISTINFO} -EXTRA_PATCHES+= ${MUNIN_PATCHES} ALL_TARGET= build-node build-plugins INSTALL_TARGET= install-node-prime install-plugins-prime NO_ARCH= yes diff --git a/sysutils/munin-node/files/patch-plugins__node.d.freebsd__if_.in b/sysutils/munin-node/files/patch-plugins__node.d.freebsd__if_.in index e10eeb737931..1c6cbae4e008 100644 --- a/sysutils/munin-node/files/patch-plugins__node.d.freebsd__if_.in +++ b/sysutils/munin-node/files/patch-plugins__node.d.freebsd__if_.in @@ -1,6 +1,42 @@ ---- plugins/node.d.freebsd/if_.in.orig 2014-04-22 19:29:32 UTC +--- plugins/node.d.freebsd/if_.in.orig 2014-10-26 14:12:24 UTC +++ plugins/node.d.freebsd/if_.in -@@ -83,9 +83,12 @@ +@@ -22,7 +22,7 @@ + INTERFACE=${0##*if_} + + if [ "$1" = "autoconf" ]; then +- if [ -x /usr/bin/netstat ]; then ++ if [ -x /sbin/ifconfig -o -x /usr/bin/netstat ]; then + echo yes + exit 0 + else +@@ -32,8 +32,12 @@ + fi + + if [ "$1" = "suggest" ]; then +- if [ -x /usr/bin/netstat ]; then +- netstat -i -b -n | sed -n -e '/^faith/d' -e '/^lo[0-9]/d' -e '/^pflog/d' -e '/<Link#[0-9]*>/s/\** .*//p' ++ if [ -x /sbin/ifconfig ] ++ then ++ ifconfig -l | sed -Ee 's/[[:<:]](pfsync|faith|pf(log|sync)|lo|plip|carp|enc|fwe)[^ ]*//g' | xargs -n 1 echo ++ exit 0 ++ elif [ -x /usr/bin/netstat ]; then ++ netstat -i -b -n | sed -n -e '/^faith/d' -e '/^lo[0-9]/d' -e '/^pf(log|sync)/d' -e '/<Link#[0-9]*>/s/\** .*//p' + exit 0 + else + exit 1 +@@ -68,8 +72,10 @@ + /<Link#[0-9]*>/ { + if (NF == 10) { + rsum += $6; osum += $9; +- } else { ++ } else if (NF == 11) { + rsum += $7; osum += $10; ++ } else { # NF == 12 ++ rsum += $8; osum += $11; + } + } + END { +@@ -83,9 +89,13 @@ if (NF == 10) { print "rbytes.value", $6; print "obytes.value", $9; @@ -8,9 +44,10 @@ + } else if (NF == 11) { print "rbytes.value", $7; print "obytes.value", $10; -+ } else { ++ } else { # NF == 12 + print "rbytes.value", $8; + print "obytes.value", $11; } }' fi ++ diff --git a/sysutils/munin-node/files/patch-plugins__node.d.freebsd__if_errcoll_.in b/sysutils/munin-node/files/patch-plugins__node.d.freebsd__if_errcoll_.in index c003ac78ac51..f012a707364a 100644 --- a/sysutils/munin-node/files/patch-plugins__node.d.freebsd__if_errcoll_.in +++ b/sysutils/munin-node/files/patch-plugins__node.d.freebsd__if_errcoll_.in @@ -1,6 +1,30 @@ ---- plugins/node.d.freebsd/if_errcoll_.in.orig 2014-04-22 19:29:32 UTC +--- plugins/node.d.freebsd/if_errcoll_.in.orig 2014-10-26 14:12:24 UTC +++ plugins/node.d.freebsd/if_errcoll_.in -@@ -59,9 +59,13 @@ +@@ -19,7 +19,7 @@ + INTERFACE=${0##*if_errcoll_} + + if [ "$1" = "autoconf" ]; then +- if [ -x /usr/bin/netstat ]; then ++ if [ -x /sbin/ifconfig -o -x /usr/bin/netstat ]; then + echo yes + exit 0 + else +@@ -29,8 +29,12 @@ + fi + + if [ "$1" = "suggest" ]; then +- if [ -x /usr/bin/netstat ]; then +- netstat -i -b -n | sed -n -e '/^faith/d' -e '/^lo[0-9]/d' -e '/^pflog/d' -e '/<Link#[0-9]*>/s/\** .*//p' ++ if [ -x /sbin/ifconfig ] ++ then ++ ifconfig -l | sed -Ee 's/[[:<:]](pfsync|faith|pf(log|sync)|lo|plip|carp|enc|fwe)[^ ]*//g' | xargs -n 1 echo ++ exit 0 ++ elif [ -x /usr/bin/netstat ]; then ++ netstat -i -b -n | sed -n -e '/^faith/d' -e '/^lo[0-9]/d' -e '/^pf(log|sync)/d' -e '/<Link#[0-9]*>/s/\** .*//p' + exit 0 + else + exit 1 +@@ -59,9 +63,13 @@ print "ierrors.value", $5; print "oerrors.value", $8; print "collisions.value", $10; @@ -9,7 +33,7 @@ print "ierrors.value", $6; print "oerrors.value", $9; print "collisions.value", $11; -+ } else { ++ } else { # NF == 12 + print "ierrors.value", $6; + print "oerrors.value", $10; + print "collisions.value", $12; diff --git a/sysutils/munin-node/files/patch-plugins__node.d.freebsd__if_packets_.in b/sysutils/munin-node/files/patch-plugins__node.d.freebsd__if_packets_.in new file mode 100644 index 000000000000..b69d74ace925 --- /dev/null +++ b/sysutils/munin-node/files/patch-plugins__node.d.freebsd__if_packets_.in @@ -0,0 +1,104 @@ +--- plugins/node.d.freebsd/if_packets_.in.orig 2014-10-27 10:21:08 UTC ++++ plugins/node.d.freebsd/if_packets_.in +@@ -0,0 +1,101 @@ ++#!@@GOODSH@@ ++# -*- sh -*- ++# ++# Wildcard-plugin to monitor network interfaces. To monitor an ++# interface, link if_<interface> to this file. E.g. ++# ++# ln -s /usr/share/munin/node/plugins-auto/if_ /etc/munin/node.d/if_eth0 ++# ++# ...will monitor eth0. ++# ++# To aggregate all network interfaces on the system (except lo0), ++# link if_aggregated to this file. ++# ++# Any device found in /usr/bin/netstat can be monitored. ++# ++# Magic markers (optional - used by munin-config and some installation ++# scripts): ++# ++#%# family=auto ++#%# capabilities=autoconf suggest ++ ++INTERFACE=${0##*if_} ++ ++if [ "$1" = "autoconf" ]; then ++ if [ -x /sbin/ifconfig -o -x /usr/bin/netstat ]; then ++ echo yes ++ exit 0 ++ else ++ echo "no (/usr/bin/netstat not found)" ++ exit 0 ++ fi ++fi ++ ++if [ "$1" = "suggest" ]; then ++ if [ -x /sbin/ifconfig ] ++ then ++ ifconfig -l | sed -Ee 's/[[:<:]](pfsync|faith|pf(log|sync)|lo|plip|carp|enc|fwe)[^ ]*//g' | xargs -n 1 echo ++ exit 0 ++ elif [ -x /usr/bin/netstat ]; then ++ netstat -i -b -n | sed -n -e '/^faith/d' -e '/^lo[0-9]/d' -e '/^pf(log|sync)/d' -e '/<Link#[0-9]*>/s/\** .*//p' ++ exit 0 ++ else ++ exit 1 ++ fi ++fi ++ ++if [ "$1" = "config" ]; then ++ ++ echo "graph_order rpackets opackets" ++ echo "graph_title $INTERFACE pps" ++ echo 'graph_args --base 1000' ++ echo 'graph_vlabel packets per ${graph_period} in (-) / out (+)' ++ echo 'graph_category network' ++ echo "graph_info This graph shows the packets counter of the $INTERFACE network interface. Please note that the traffic is shown in packets per second." ++ echo 'rpackets.label received' ++ echo 'rpackets.type COUNTER' ++ echo 'rpackets.graph no' ++ ++ echo 'rpackets.min 0' ++ echo 'opackets.label pps' ++ echo 'opackets.type COUNTER' ++ echo 'opackets.negative rpackets' ++ ++ echo 'opackets.min 0' ++ echo "opackets.info Packets sent (+) and received (-) on the $INTERFACE network interface." ++ exit 0 ++fi ++ ++if [ "$INTERFACE" = "aggregated" ]; then ++ /usr/bin/netstat -i -b -n | grep -v '^lo' | awk ' ++BEGIN { rsum = 0; osum = 0; } ++/<Link#[0-9]*>/ { ++ if (NF == 10) { ++ rsum += $4; osum += $7; ++ } else if (NF == 11) { ++ rsum += $5; osum += $8; ++ } else { # NF == 12 ++ rsum += $6; osum += $9; ++ } ++} ++END { ++ printf "rpackets.value %i\n", rsum; ++ printf "opackets.value %i\n", osum; ++}' ++ ++else ++ /usr/bin/netstat -i -b -n -I $INTERFACE | awk ' ++/<Link#[0-9]*>/ { ++ if (NF == 10) { ++ print "rpackets.value", $4; ++ print "opackets.value", $7; ++ } else if (NF == 11) { ++ print "rbytes.value", $5; ++ print "obytes.value", $8; ++ } else { # NF == 12 ++ print "rpackets.value", $6; ++ print "opackets.value", $9; ++ } ++}' ++fi ++ diff --git a/sysutils/munin-node/pkg-plist b/sysutils/munin-node/pkg-plist index 5e5ff31f6b5d..6df03ce7c49a 100644 --- a/sysutils/munin-node/pkg-plist +++ b/sysutils/munin-node/pkg-plist @@ -102,6 +102,7 @@ sbin/munin-sched %%DATADIR%%/plugins/http_loadtime %%DATADIR%%/plugins/if_ %%DATADIR%%/plugins/if_errcoll_ +%%DATADIR%%/plugins/if_packets_ %%DATADIR%%/plugins/ifx_concurrent_sessions_ %%DATADIR%%/plugins/iostat %%DATADIR%%/plugins/ipac-ng |