mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-25 18:38:30 +00:00
Make awk script more readable
This commit is contained in:
parent
afe87e904e
commit
234a753fea
1 changed files with 15 additions and 2 deletions
|
@ -48,8 +48,21 @@ case $1 in
|
||||||
echo 'graph_vlabel bits per ${graph_period}'
|
echo 'graph_vlabel bits per ${graph_period}'
|
||||||
echo 'graph_category network'
|
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."
|
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
|
exit 0
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue