mirror of
https://github.com/munin-monitoring/muninlite.git
synced 2024-12-22 13:52:13 +01:00
Fix error messages on server due to missing ethtool on node
Source: patch "100-fix-no-ethtool" from OpenWrt Author: cshore
This commit is contained in:
parent
d9b1b1ad3f
commit
3e0ecfe678
1 changed files with 8 additions and 4 deletions
12
plugins/if_
12
plugins/if_
|
@ -15,10 +15,14 @@ config_if() {
|
||||||
echo "up.min 0"
|
echo "up.min 0"
|
||||||
echo "up.negative down"
|
echo "up.negative down"
|
||||||
echo "up.cdef up,8,*"
|
echo "up.cdef up,8,*"
|
||||||
if ethtool $1 | grep -q Speed; then
|
if [ -n "$(which ethtool)" ]; then
|
||||||
MAX=$(($(ethtool $1 | grep Speed | sed -e 's/[[:space:]]\{1,\}/ /g' -e 's/^ //' -e 's/M.*//' | cut -d\ -f2) * 1000000))
|
if [ -x "$(which ethtool)" ]; then
|
||||||
echo "up.max $MAX"
|
if ethtool $1 | grep -q Speed; then
|
||||||
echo "down.max $MAX"
|
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
|
fi
|
||||||
}
|
}
|
||||||
fetch_if() {
|
fetch_if() {
|
||||||
|
|
Loading…
Reference in a new issue