You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

22 lines
748 B

--- a/plugins/if_
+++ b/plugins/if_
@@ -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)
}
--- a/plugins/if_err_
+++ b/plugins/if_err_
@@ -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)
}