Previous page: ipcop modifications
Next page: Link Quality

Graph colour

Version 2.0.2

I am not keen on the default traffic graph colours (green/blue) and wanted red/green.

This is a quick two line change in the file /usr/local/bin/makegraphs

in sub-procedure updateifgraph make the changes in green


push @rrd, "-v$Lang::tr{'bits per second'}";
push @rrd, "DEF:incoming=$rrdlog/$interface.rrd:incoming:AVERAGE";
push @rrd, "DEF:outgoing=$rrdlog/$interface.rrd:outgoing:AVERAGE";
push @rrd, "CDEF:incomingbits=incoming,8,*";
push @rrd, "CDEF:outgoingbits=outgoing,8,*";
push @rrd, "CDEF:outgoingnegbits=outgoing,-8,*";
push @rrd, "HRULE:0#000000";
push @rrd, "AREA:incomingbits#33CC33:$Lang::tr{'incoming traffic in bits per second'}\\j";
push @rrd, "GPRINT:incomingbits:MAX:$Lang::tr{'maximal'}\\:%8.3lf %sbps";
push @rrd, "GPRINT:incomingbits:AVERAGE:$Lang::tr{'average'}\\:%8.3lf %sbps";
push @rrd, "GPRINT:incomingbits:LAST:$Lang::tr{'current'}\\:%8.3lf %sbps\\j";
push @rrd, "AREA:outgoingnegbits#FF3333:$Lang::tr{'outgoing traffic in bits per second'}\\j";
push @rrd, "GPRINT:outgoingbits:MAX:$Lang::tr{'maximal'}\\:%8.3lf %sbps";
push @rrd, "GPRINT:outgoingbits:AVERAGE:$Lang::tr{'average'}\\:%8.3lf %sbps";
push @rrd, "GPRINT:outgoingbits:LAST:$Lang::tr{'current'}\\:%8.3lf %sbps\\j";

 

The result is this:


But I also preferred the graph area having a darker outline to make it more pleasant on the eye.  To achieve this we need to add two lines to the same sub-procedure (identified by the green background)


push @rrd, "-v$Lang::tr{'bits per second'}";
push @rrd, "DEF:incoming=$rrdlog/$interface.rrd:incoming:AVERAGE";
push @rrd, "DEF:outgoing=$rrdlog/$interface.rrd:outgoing:AVERAGE";
push @rrd, "CDEF:incomingbits=incoming,8,*";
push @rrd, "CDEF:outgoingbits=outgoing,8,*";
push @rrd, "CDEF:outgoingnegbits=outgoing,-8,*";
push @rrd, "HRULE:0#000000";
push @rrd, "AREA:incomingbits#33CC33:$Lang::tr{'incoming traffic in bits per second'}\\j";
push @rrd, "LINE1:incomingbits#006600";
push @rrd, "GPRINT:incomingbits:MAX:$Lang::tr{'maximal'}\\:%8.3lf %sbps";
push @rrd, "GPRINT:incomingbits:AVERAGE:$Lang::tr{'average'}\\:%8.3lf %sbps";
push @rrd, "GPRINT:incomingbits:LAST:$Lang::tr{'current'}\\:%8.3lf %sbps\\j";
push @rrd, "AREA:outgoingnegbits#FF3333:$Lang::tr{'outgoing traffic in bits per second'}\\j";
push @rrd, "LINE1:outgoingnegbits#990000";
push @rrd, "GPRINT:outgoingbits:MAX:$Lang::tr{'maximal'}\\:%8.3lf %sbps";
push @rrd, "GPRINT:outgoingbits:AVERAGE:$Lang::tr{'average'}\\:%8.3lf %sbps";
push @rrd, "GPRINT:outgoingbits:LAST:$Lang::tr{'current'}\\:%8.3lf %sbps\\j";

My latest graphs can be seen here.

This results in this:



^Top
Previous page: ipcop modifications
Next page: Link Quality