2
0
mirror of https://github.com/munin-monitoring/contrib.git synced 2018-11-08 00:59:34 +01:00

Output fields of tc can vary, possibly causing corrupted data to be gathered.

Look specifically for the "bytes" keyword
This commit is contained in:
Nye Liu 2016-10-26 14:14:26 -07:00
parent 234a753fea
commit 3dd825dd62

View File

@ -68,9 +68,15 @@ case $1 in
esac
# the root(s)
mytc $DEVICE | grep -v " parent " | awk "{ print \$2 \"_\" \$3 \".value \" \$14}"
mytc $DEVICE | grep -v " parent " | awk '{
split(substr($0, match($0, /[0-9]+ [Bb]ytes/)), a, " ");
print $2 "_" $3 ".value " a[1];
}'
# the child(s)
mytc $DEVICE | grep " parent " | awk "{ print \$2 \"_\" \$3 \".value \" \$19}"
mytc $DEVICE | grep " parent " | awk '{
split(substr($0, match($0, /[0-9]+ [Bb]ytes/)), a, " ");
print $2 "_" $3 ".value " a[1];
}'
exit 0