cd /www in=$(ifconfig wlan1 |grep bytes|cut -d":" -f2|cut -d" " -f1) out=$(ifconfig wlan1 |grep bytes|cut -d":" -f3|cut -d" " -f1) echo $in " " $out t=$in":"$out; rrdtool update /www/iptraf.rrd --template in:out N:$t; rrdtool graph /www/iptraf1.png --start -12h --end now \ --vertical-label "Traffic B/s" \ -a PNG \ DEF:temp1=/www/iptraf.rrd:in:AVERAGE \ DEF:temp2=/www/iptraf.rrd:out:AVERAGE \ LINE1:temp1#FF0000:"in" \ LINE1:temp2#00FF00:"out" #rrdtool create iptraf.rrd \ # DS:in:COUNTER:600:U:12500000 \ # DS:out:COUNTER:600:U:12500000 \ # RRA:AVERAGE:0.5:1:600 \ # RRA:AVERAGE:0.5:6:700 \ # RRA:AVERAGE:0.5:24:775 \ # RRA:AVERAGE:0.5:288:797 \ # rrdtool fetch /www/iptraf.rrd AVERAGE;