#!/bin/sh #------------------------------------------------------------------------------ # OPT_QOS /etc/rrdtool/qos.params __FLI4LVER__ # Creation: 2008-05-02 Joe # Last Update: $Id$ #------------------------------------------------------------------------------ RRDTOOL_PARAMS_LOADED_qos='yes' local graph_title= local graph_unit= local graph_fmt= local graph_ds1= local interface= c1=ff0000 c2=ffff00 c3=00ff00 c4=00ffff c5=0000ff c6=ff00ff c7=ff8000 c8=80ff00 c9=00ff80 c10=0080ff c11=8000ff c12=ff0080 c13=ff4000 c14=bfff00 c15=00ff40 c16=00bfff c17=4000ff c18=ff00bf c19=ffbf00 c20=40ff00 c21=00ffbf c22=0040ff c23=bf00ff c24=ff0040 c25=ff2200 c26=ddff00 c27=00ff22 c28=00ddff c29=2200ff c30=ff00dd c31=ff6200 c32=9dff00 c33=00ff62 c34=009dff c35=6200ff c36=ff009d c37=ffa100 c38=5eff00 c39=00ffa1 c40=005eff c41=a100ff c42=ff005e c43=ffe100 c44=1eff00 c45=00ffe1 c46=001eff c47=e100ff c48=ff001e c49=ff1100 c50=eeff00 c51=00ff11 c52=00eeff c53=1100ff c54=ff00ee c55=ff3300 c56=ccff00 c57=00ff33 c58=00ccff c59=3300ff c60=ff00cc c61=ff5100 c62=aeff00 c63=00ff51 c64=00aeff c65=5100ff c66=ff00ae c67=ff7300 c68=8cff00 c69=00ff73 c70=008cff c71=7300ff c72=ff008c c73=ff9000 c74=6fff00 c75=00ff90 c76=006fff c77=9000ff c78=ff006f c79=ffb300 c80=4dff00 c81=00ffb3 c82=004dff c83=b300ff c84=ff004d c85=ffd000 c86=2fff00 c87=00ffd0 c88=002fff c89=d000ff c90=ff002f c91=fff200 c92=0dff00 c93=00fff2 c94=000dff c95=f200ff c96=ff000d rrdtool_gen_params_qos() { local item=$1 case "$item" in "down")interface='imq0';; "up") interface='imq1';; esac eval rrdtool_gen_params_qos_$item } rrdtool_gen_params_qos_down() { graph_title="$_DOWN_title" graph_unit="$_DOWN_unit" graph_fmt="%3.0lf %s" graph_ds1="$_DOWN_ds1" rrdtool_gen_params_qos_down_and_up } rrdtool_gen_params_qos_up() { graph_title="$_UP_title" graph_unit="$_UP_unit" graph_fmt="%3.0lf %s" graph_ds1="$_UP_ds1" rrdtool_gen_params_qos_down_and_up } rrdtool_gen_params_qos_down_and_up() { local label= rrdtool_addCache "-c BACK#eeeeee -l 0" rrdtool_addCache "-t '$graph_title' -v '$graph_unit'" rrdtool_addCache "-c CANVAS#000000" # rrdtool_addCache "-s $intervall" rrdtool_gen_printHeader `expr ${#graph_ds1} + 2` classes=`tc -s class show dev $interface|grep 'class htb'|cut -d ' ' -f 3|cut -d ':' -f 2` for i in $classes do [ $i -le 9 ] && label="$i " || label=$i eval local 'color=$c'$i rrdtool_addCache "DEF:class_$i=$rrdFile:$i:AVERAGE" rrdtool_gen_defStats "class_${i}_stats" "class_${i}" rrdtool_addCache "LINE1:class_${i}#$color:'$graph_ds1$label'" rrdtool_gen_printStats "class_${i}_stats" done }