#! /bin/sh
RRDFILE="/etc/tcgraph/tcgraph.rrd"

rrdtool graph $1 --start $2 --title "Upload stats on Zerhuel - period=$2" \
--width 600 --vertical-label "bits/s" \
--color BACK#333333 --color SHADEA#000000 --color SHADEB#000000 \
--color CANVAS#000000 --color GRID#999999 --color MGRID#666666 \
--color FONT#CCCCCC --color FRAME#333333 \
TEXTALIGN:left \
DEF:low_udp=$RRDFILE:low_udp:AVERAGE \
AREA:low_udp#99FFFF:low_udp:STACK \
GPRINT:low_udp:MAX:"\tmax = %6.2lf%Sbps" \
GPRINT:low_udp:LAST:"\tlast = %6.2lf%Sbps" \
GPRINT:low_udp:AVERAGE:"\tavg = %6.2lf%Sbps" \
COMMENT:\\s COMMENT:\\s \
DEF:ssh=$RRDFILE:ssh:AVERAGE \
AREA:ssh#145f23:ssh:STACK \
GPRINT:ssh:MAX:"\t\tmax = %6.2lf%Sbps" \
GPRINT:ssh:LAST:"\tlast = %6.2lf%Sbps" \
GPRINT:ssh:AVERAGE:"\tavg = %6.2lf%Sbps" \
COMMENT:\\s COMMENT:\\s \
DEF:http=$RRDFILE:http:AVERAGE \
AREA:http#ff0000:http:STACK \
GPRINT:http:MAX:"\t\tmax = %6.2lf%Sbps" \
GPRINT:http:LAST:"\tlast = %6.2lf%Sbps" \
GPRINT:http:AVERAGE:"\tavg = %6.2lf%Sbps" \
COMMENT:\\s COMMENT:\\s \
DEF:https=$RRDFILE:https:AVERAGE \
AREA:https#990066:https:STACK \
GPRINT:https:MAX:"\tmax = %6.2lf%Sbps" \
GPRINT:https:LAST:"\tlast = %6.2lf%Sbps" \
GPRINT:https:AVERAGE:"\tavg = %6.2lf%Sbps" \
COMMENT:\\s COMMENT:\\s \
DEF:mail=$RRDFILE:mail:AVERAGE \
AREA:mail#ffe700:mail:STACK \
GPRINT:mail:MAX:"\t\tmax = %6.2lf%Sbps" \
GPRINT:mail:LAST:"\tlast = %6.2lf%Sbps" \
GPRINT:mail:AVERAGE:"\tavg = %6.2lf%Sbps" \
COMMENT:\\s COMMENT:\\s \
DEF:ftp=$RRDFILE:ftp:AVERAGE \
AREA:ftp#00CC33:ftp:STACK \
GPRINT:ftp:MAX:"\t\tmax = %6.2lf%Sbps" \
GPRINT:ftp:LAST:"\tlast = %6.2lf%Sbps" \
GPRINT:ftp:AVERAGE:"\tavg = %6.2lf%Sbps" \
COMMENT:\\s COMMENT:\\s \
DEF:others=$RRDFILE:others:AVERAGE \
AREA:others#0066CC:others:STACK \
GPRINT:others:MAX:"\tmax = %6.2lf%Sbps" \
GPRINT:others:LAST:"\tlast = %6.2lf%Sbps" \
GPRINT:others:AVERAGE:"\tavg = %6.2lf%Sbps" \
COMMENT:\\s COMMENT:\\s  \
DEF:bittorrent=$RRDFILE:bittorrent:AVERAGE \
AREA:bittorrent#25056b:bittorrent:STACK \
GPRINT:bittorrent:MAX:"\tmax = %6.2lf%Sbps" \
GPRINT:bittorrent:LAST:"\tlast = %6.2lf%Sbps" \
GPRINT:bittorrent:AVERAGE:"\tavg = %6.2lf%Sbps" \
COMMENT:\\s COMMENT:\\s 
