The every day things from Thalamus' life.

Thalamus' Blog

14 May, 2006

Some more mrtg, my laptop and stuff

Filed under: ComputerStuff_en — Thalamus @ 15:09

Hi again !

Been poking around some more with mrtg – last project was to make a nice graph of my incoming and outgoing traffic. Ofc, using rrdtool. So, if your interessted in doing something like this for yourself – here is the graph output (static png) and here is the perl code that produces this

rrdtool graph /home/thalamus/public_html/test.png \
--start=now-9hour \
--imgformat=PNG \
--width=500 \
--title="Internet - last 9 hours" \
--height=120 \
--base=1000 \
--vertical-label="In/Out Traffic" \
--interlaced \
-c BACK#000000 \
-c SHADEA#000000 \
-c SHADEB#000000 \
-c FONT#DDDDDD \
-c CANVAS#202020 \
-c GRID#666666 \
-c MGRID#AAAAAA \
-c FRAME#202020 \
-c ARROW#FFFFFF \
DEF:oa=/var/www/mrtg/localhost_2.rrd:ds0:AVERAGE \
DEF:oe=/var/www/mrtg/localhost_2.rrd:ds1:AVERAGE \
VDEF:oa0max=oa,MAXIMUM \
VDEF:oa0avg=oa,AVERAGE \
VDEF:oa0min=oa,MINIMUM \
VDEF:oa0last=oa,LAST \
VDEF:oe1max=oe,MAXIMUM \
VDEF:oe1avg=oa,AVERAGE \
VDEF:oe1min=oe,MINIMUM \
VDEF:oe1last=oa,LAST \
CDEF:sh_oa100=oa,7.92,*  "AREA:sh_oa100#FF0000:Inbound\n" \
CDEF:sh_oe100=oe,7.92,*  "AREA:sh_oe100#00FF00:Outbound" \
CDEF:sh_oa90=oa,7.20,* AREA:sh_oa90#E10000 \
CDEF:sh_oa85=oa,6.80,* AREA:sh_oa85#D20000 \
CDEF:sh_oa80=oa,6.40,* AREA:sh_oa80#C30000 \
CDEF:sh_oa75=oa,6.00,* AREA:sh_oa75#B40000 \
CDEF:sh_oa70=oa,5.60,* AREA:sh_oa70#A50000 \
CDEF:sh_oa65=oa,5.20,* AREA:sh_oa65#960000 \
CDEF:sh_oa60=oa,4.80,* AREA:sh_oa60#870000 \
CDEF:sh_oa55=oa,4.40,* AREA:sh_oa55#780000 \
CDEF:sh_oa50=oa,4.00,* AREA:sh_oa50#690000 \
CDEF:sh_oa45=oa,3.60,* AREA:sh_oa45#5A0000 \
CDEF:sh_oa40=oa,3.20,* AREA:sh_oa40#4B0000 \
CDEF:sh_oa35=oa,2.80,* AREA:sh_oa35#3C0000 \
CDEF:sh_oa30=oa,2.40,* AREA:sh_oa30#2D0000 \
CDEF:sh_oa25=oa,2.00,* AREA:sh_oa25#180000 \
CDEF:sh_oa20=oa,1.60,* AREA:sh_oa20#0F0000 \
CDEF:sh_oa15=oa,1.20,* AREA:sh_oa15#000000 \
CDEF:sh_oe90=oe,7.20,* LINE:sh_oe90#00E100 \
CDEF:sh_oe85=oe,6.80,* LINE:sh_oe85#00D200 \
CDEF:sh_oe80=oe,6.40,* LINE:sh_oe80#00C300 \
CDEF:sh_oe75=oe,6.00,* LINE:sh_oe75#00B400 \
CDEF:sh_oe70=oe,5.60,* LINE:sh_oe70#00A500 \
CDEF:sh_oe65=oe,5.20,* LINE:sh_oe65#009600 \
CDEF:sh_oe60=oe,4.80,* LINE:sh_oe60#008700 \
CDEF:sh_oe55=oe,4.40,* LINE:sh_oe55#007800 \
CDEF:sh_oe50=oe,4.00,* LINE:sh_oe50#006900 \
CDEF:sh_oe45=oe,3.60,* LINE:sh_oe45#005A00 \
CDEF:sh_oe40=oe,3.20,* LINE:sh_oe40#004B00 \
CDEF:sh_oe35=oe,2.80,* LINE:sh_oe35#003C00 \
CDEF:sh_oe30=oe,2.40,* LINE:sh_oe30#002D00 \
CDEF:sh_oe25=oe,2.00,* LINE:sh_oe25#001800 \
CDEF:sh_oe20=oe,1.60,* LINE:sh_oe20#000F00 \
CDEF:sh_oe15=oe,1.20,* LINE:sh_oe15#000000 \
COMMENT:"    \n" \
COMMENT:"Inbound " \
CDEF:oa_bps=oa,1,* \
CDEF:oe_bps=oe,1,* \
"GPRINT:oa_bps:MAX:Max %3.2lf %sbps" \
"GPRINT:oa_bps:AVERAGE:Avg %3.2lf %sbps" \
"GPRINT:oa_bps:LAST:Now %3.2lf %sbps\n" \
COMMENT:"Outbound" \
"GPRINT:oe_bps:MAX:Max %3.2lf %sbps" \
"GPRINT:oe_bps:AVERAGE:Avg %3.2lf %sbps" \
"GPRINT:oe_bps:LAST:Now %3.2lf %sbps\n" \

It ain’t perfect yet – that I’m aware of. But, I guess it can be used as a template for some of you guys at least.

Yesteday night – I totally disassembeled my old laptop and took out the cpu fan, replacing it with the one inside the laptop I normally use. Wee, success – its much more quiet now.

• • •