From a98f7aaabbc17e58dd0ea66231e4039d83515f4a Mon Sep 17 00:00:00 2001 From: Daniel Dickinson Date: Mon, 23 May 2011 21:06:08 +0000 Subject: [PATCH] muninlite: Fixes: Error messages on server due to missing ethtool on node, recognition of tapX devices, recognition of openwrt bridges, and workaround for dashes in interface names (replace with an underscore on graph) SVN-Revision: 26973 --- .../patches/100-fix-no-ethtool.patch | 21 ++++++++++++++++++ admin/muninlite/patches/200-add-tap-dev.patch | 20 +++++++++++++++++ .../patches/210-add-bridge-devs.patch | 22 +++++++++++++++++++ 3 files changed, 63 insertions(+) create mode 100644 admin/muninlite/patches/100-fix-no-ethtool.patch create mode 100644 admin/muninlite/patches/200-add-tap-dev.patch create mode 100644 admin/muninlite/patches/210-add-bridge-devs.patch diff --git a/admin/muninlite/patches/100-fix-no-ethtool.patch b/admin/muninlite/patches/100-fix-no-ethtool.patch new file mode 100644 index 000000000..88f7e3056 --- /dev/null +++ b/admin/muninlite/patches/100-fix-no-ethtool.patch @@ -0,0 +1,21 @@ +--- a/plugins/if_ ++++ b/plugins/if_ +@@ -15,10 +15,14 @@ config_if() { + echo "up.min 0" + echo "up.negative down" + echo "up.cdef up,8,*" +- if ethtool $1 | grep -q Speed; then +- MAX=$(($(ethtool $1 | grep Speed | sed -e 's/[[:space:]]\{1,\}/ /g' -e 's/^ //' -e 's/M.*//' | cut -d\ -f2) * 1000000)) +- echo "up.max $MAX" +- echo "down.max $MAX" ++ if [ -n "$(which ethtool)" ]; then ++ if [ -x "$(which ethtool)" ]; then ++ if ethtool $1 | grep -q Speed; then ++ MAX=$(($(ethtool $1 | grep Speed | sed -e 's/[[:space:]]\{1,\}/ /g' -e 's/^ //' -e 's/M.*//' | cut -d\ -f2) * 1000000)) ++ echo "up.max $MAX" ++ echo "down.max $MAX" ++ fi ++ fi + fi + } + fetch_if() { diff --git a/admin/muninlite/patches/200-add-tap-dev.patch b/admin/muninlite/patches/200-add-tap-dev.patch new file mode 100644 index 000000000..fa46ce6b3 --- /dev/null +++ b/admin/muninlite/patches/200-add-tap-dev.patch @@ -0,0 +1,20 @@ +--- a/munin-node.in ++++ b/munin-node.in +@@ -72,7 +72,7 @@ RES="" + for PLUG in $PLUGINS + do + if [ "$PLUG" = "if_" ]; then +- for INTER in $(grep '^ *\(ppp\|eth\|wlan\|ath\|ra\|ipsec\)\([^:]\)\{1,\}:' /proc/net/dev | cut -f1 -d: | sed 's/ //g'); ++ for INTER in $(grep '^ *\(ppp\|eth\|wlan\|ath\|ra\|ipsec\|tap\)\([^:]\)\{1,\}:' /proc/net/dev | cut -f1 -d: | sed 's/ //g'); + do + INTERRES=$(echo $INTER | sed 's/\./VLAN/') + RES="$RES if_$INTERRES" +@@ -80,7 +80,7 @@ do + eval "config_if_${INTERRES}() { config_if $INTER $@; };" + done + elif [ "$PLUG" = "if_err_" ]; then +- for INTER in $(grep '^ *\(ppp\|eth\|wlan\|ath\|ra\|ipsec\)\([^:]\)\{1,\}:' /proc/net/dev | cut -f1 -d: | sed 's/ //g'); ++ for INTER in $(grep '^ *\(ppp\|eth\|wlan\|ath\|ra\|ipsec\|tap\)\([^:]\)\{1,\}:' /proc/net/dev | cut -f1 -d: | sed 's/ //g'); + do + INTERRES=$(echo $INTER | sed 's/\./VLAN/') + RES="$RES if_err_$INTERRES" diff --git a/admin/muninlite/patches/210-add-bridge-devs.patch b/admin/muninlite/patches/210-add-bridge-devs.patch new file mode 100644 index 000000000..0efe3761c --- /dev/null +++ b/admin/muninlite/patches/210-add-bridge-devs.patch @@ -0,0 +1,22 @@ +--- a/munin-node.in ++++ b/munin-node.in +@@ -72,7 +72,8 @@ RES="" + for PLUG in $PLUGINS + do + if [ "$PLUG" = "if_" ]; then +- for INTER in $(grep '^ *\(ppp\|eth\|wlan\|ath\|ra\|ipsec\|tap\)\([^:]\)\{1,\}:' /proc/net/dev | cut -f1 -d: | sed 's/ //g'); ++ for INTER in $(grep '^ *\(ppp\|eth\|wlan\|ath\|ra\|ipsec\|tap\|br-\)\([^:]\)\{1,\}:' /proc/net/dev | cut -f1 -d: | sed 's/ //g +++s/\-/_/g'); + do + INTERRES=$(echo $INTER | sed 's/\./VLAN/') + RES="$RES if_$INTERRES" +@@ -80,7 +81,8 @@ do + eval "config_if_${INTERRES}() { config_if $INTER $@; };" + done + elif [ "$PLUG" = "if_err_" ]; then +- for INTER in $(grep '^ *\(ppp\|eth\|wlan\|ath\|ra\|ipsec\|tap\)\([^:]\)\{1,\}:' /proc/net/dev | cut -f1 -d: | sed 's/ //g'); ++ for INTER in $(grep '^ *\(ppp\|eth\|wlan\|ath\|ra\|ipsec\|tap\|br-\)\([^:]\)\{1,\}:' /proc/net/dev | cut -f1 -d: | sed 's/ //g +++s/\-/_/g'); + do + INTERRES=$(echo $INTER | sed 's/\./VLAN/') + RES="$RES if_err_$INTERRES" -- 2.30.2