diff --git a/plugins/network/tc_ b/plugins/network/tc_ index 0d21c6cf..c912c89d 100755 --- a/plugins/network/tc_ +++ b/plugins/network/tc_ @@ -48,8 +48,21 @@ case $1 in echo 'graph_vlabel bits per ${graph_period}' echo 'graph_category network' echo "graph_info This graph shows the TC classes traffic of the $DEVICE network interface. Please note that the traffic is shown in bits per second, not bytes." - - mytc $DEVICE | tr "_" " " | awk '{ print $2 "_" $3 "_" $4 ".label " $2 "/" $3 ":" $4 "\n" $2 "_" $3 "_" $4 ".type DERIVE\n" $2 "_" $3 "_" $4 ".min 0\n" $2 "_" $3 "_" $4 ".cdef " $2 "_" $3 "_" $4 ",8,*" }' + + # the root(s) + mytc $DEVICE | grep -v " parent " | tr "_" " " | awk '{ + print $2 "_" $3 "_" $4 ".label " $2 "/" $3 ":" $4; + print $2 "_" $3 "_" $4 ".type DERIVE"; + print $2 "_" $3 "_" $4 ".min 0"; + print $2 "_" $3 "_" $4 ".cdef " $2 "_" $3 "_" $4 ",8,*"; + }' + # the child(s) + mytc $DEVICE | grep " parent " | tr "_" " " | awk '{ + print $2 "_" $3 "_" $4 ".label " $2 "/" $3 ":" $4; + print $2 "_" $3 "_" $4 ".type DERIVE"; + print $2 "_" $3 "_" $4 ".min 0"; + print $2 "_" $3 "_" $4 ".cdef " $2 "_" $3 "_" $4 ",8,*"; + }' exit 0 ;; esac