crusader |
Subversion Repositories: |
Compare with Previous - Blame - Download
#!/bin/bash
device=$1
timediff=$2
suffix=$3
popis=$4
PATH=$PATH:/opt/rrdtool/bin
datadir=/var/statistiky
cd $datadir
now=`date +%s`
rrdtool graph ${device}_${suffix}.png --imgformat PNG --start `expr $now - ${timediff}` --end $now \
DEF:inbps=${device}.rrd:input:AVERAGE \
DEF:outbps=${device}.rrd:output:AVERAGE \
CDEF:inbpsreal=inbps,LOG \
LINE2:inbpsreal#FF0000:"In traffic" \
CDEF:outbps2=outbps,LOG \
LINE2:outbps2#0000FF:"Out traffic" \
--logarithmic \
--alt-autoscale \
--vertical-label Bytes/s \
--height 200 \
--title "${device} ${popis}"
mv ${device}_${suffix}.png /var/www/htdocs/stat/img