Browse Source

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 <martin.blumenstingl@googlemail.com>
Signed-off-by: Jonathan McCrohan <jmccrohan@gmail.com>
Martin Blumenstingl 9 years ago
parent
commit
d7b9595482

+ 1
- 1
admin/muninlite/Makefile View File

@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
9 9
 
10 10
 PKG_NAME:=muninlite
11 11
 PKG_VERSION:=1.0.4
12
-PKG_RELEASE:=7
12
+PKG_RELEASE:=8
13 13
 
14 14
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 15
 PKG_SOURCE_URL:=@SF/$(PKG_NAME)

+ 2
- 2
admin/muninlite/patches/220-modify-ifname-parser.patch View File

@@ -5,7 +5,7 @@
5 5
  }
6 6
  fetch_if() {
7 7
 -  IINFO=$(grep "$1:" /proc/net/dev | cut -d: -f2 | sed -e 's/  / /g')
8
-+  IINFO=$(cat /proc/net/dev | sed -e 's/-/_/g' | grep "$1:" | cut -d: -f2 | sed -e 's/  */ /g' -e 's/^[ \t]*//')
8
++  IINFO=$(grep "$1:" /proc/net/dev | cut -d: -f2 | sed -e 's/  */ /g' -e 's/^[ \t]*//')
9 9
    echo "down.value" $(echo $IINFO | cut -d\  -f1)
10 10
    echo "up.value" $(echo $IINFO | cut -d\  -f9)
11 11
  }
@@ -16,7 +16,7 @@
16 16
  }
17 17
  fetch_if_err() {
18 18
 -  IINFO=$(grep "$1:" /proc/net/dev | cut -d: -f2 | sed -e 's/  / /g')
19
-+  IINFO=$(cat /proc/net/dev | sed -e 's/-/_/g' | grep "$1:" | cut -d: -f2 | sed -e 's/  */ /g' -e 's/^[ \t]*//')
19
++  IINFO=$(grep "$1:" /proc/net/dev | cut -d: -f2 | sed -e 's/  */ /g' -e 's/^[ \t]*//')
20 20
    echo "rcvd.value" $(echo $IINFO | cut -d\  -f3)
21 21
    echo "trans.value" $(echo $IINFO | cut -d\  -f11)
22 22
  }