From d7b95954821d4f28139c1611b3b382a03f528786 Mon Sep 17 00:00:00 2001 From: Martin Blumenstingl Date: Sat, 7 Nov 2015 18:23:08 +0100 Subject: [PATCH] muninlite: Fix fetching data for interfaces with a dash in the name munin-node passes the original interface name (as extracted from /proc/net/dev) to if_* and if_err_*. Thus replacing dash with underscore results in interfaces not being found anymore. Closes: #1927 Signed-off-by: Martin Blumenstingl Signed-off-by: Jonathan McCrohan --- admin/muninlite/Makefile | 2 +- admin/muninlite/patches/220-modify-ifname-parser.patch | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/admin/muninlite/Makefile b/admin/muninlite/Makefile index 4cf700ba9..ef7e11d8d 100644 --- a/admin/muninlite/Makefile +++ b/admin/muninlite/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=muninlite PKG_VERSION:=1.0.4 -PKG_RELEASE:=7 +PKG_RELEASE:=8 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=@SF/$(PKG_NAME) diff --git a/admin/muninlite/patches/220-modify-ifname-parser.patch b/admin/muninlite/patches/220-modify-ifname-parser.patch index 95655cfbd..6a2ba236f 100644 --- a/admin/muninlite/patches/220-modify-ifname-parser.patch +++ b/admin/muninlite/patches/220-modify-ifname-parser.patch @@ -5,7 +5,7 @@ } fetch_if() { - IINFO=$(grep "$1:" /proc/net/dev | cut -d: -f2 | sed -e 's/ / /g') -+ IINFO=$(cat /proc/net/dev | sed -e 's/-/_/g' | grep "$1:" | cut -d: -f2 | sed -e 's/ */ /g' -e 's/^[ \t]*//') ++ IINFO=$(grep "$1:" /proc/net/dev | cut -d: -f2 | sed -e 's/ */ /g' -e 's/^[ \t]*//') echo "down.value" $(echo $IINFO | cut -d\ -f1) echo "up.value" $(echo $IINFO | cut -d\ -f9) } @@ -16,7 +16,7 @@ } fetch_if_err() { - IINFO=$(grep "$1:" /proc/net/dev | cut -d: -f2 | sed -e 's/ / /g') -+ IINFO=$(cat /proc/net/dev | sed -e 's/-/_/g' | grep "$1:" | cut -d: -f2 | sed -e 's/ */ /g' -e 's/^[ \t]*//') ++ IINFO=$(grep "$1:" /proc/net/dev | cut -d: -f2 | sed -e 's/ */ /g' -e 's/^[ \t]*//') echo "rcvd.value" $(echo $IINFO | cut -d\ -f3) echo "trans.value" $(echo $IINFO | cut -d\ -f11) }