mirror of
https://github.com/munin-monitoring/muninlite.git
synced 2024-11-14 07:41:12 +01:00
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. Source: patch "220-modify-ifname-parser" from OpenWrt Author: Martin Blumenstingl
This commit is contained in:
parent
f906a5f4da
commit
7b4f376daf
2 changed files with 2 additions and 2 deletions
|
@ -26,7 +26,7 @@ config_if() {
|
|||
fi
|
||||
}
|
||||
fetch_if() {
|
||||
IINFO=$(grep "$1:" /proc/net/dev | cut -d: -f2 | sed -e 's/ / /g')
|
||||
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)
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ config_if_err() {
|
|||
echo "trans.warning 1"
|
||||
}
|
||||
fetch_if_err() {
|
||||
IINFO=$(grep "$1:" /proc/net/dev | cut -d: -f2 | sed -e 's/ / /g')
|
||||
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)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue