Flow wrt Red
Tested on: 1.4.21
Because the GREEN, ORANGE and EXTRA graphs refered to in/out with respect to the firewall interface, I wanted them to refer to traffic to the internet. So I amended the updateifgraph procedure in /usr/local/bin/makegraphs further. This shows green on all graphs as data 'incoming from the internet/red zone' or more correctly 'with respect to the LANs/client PCs on the respective interfaces'.

- Here is the replacement updateifgraph procedure
sub updateifgraph {
my $interface = $_[0];
my $period = $_[1];if ($interface eq "RED") {
RRDs::graph ("$graphs/$interface-$period.png",
"--start", "-1$period", "-aPNG", "-i", "-z",
"-w 500", "-h 100",
"--color", "SHADEA#EAE9EE",
"--color", "SHADEB#EAE9EE",
"--color", "BACK#EAE9EE",
"-t $tr{'traffic on'} $interface ($tr{'graph per'} $tr{$period})",
"-v$tr{'bytes per second'}",
"DEF:incoming=$rrdlog/$interface.rrd:incoming:AVERAGE",
"DEF:outgoing=$rrdlog/$interface.rrd:outgoing:AVERAGE",
"CDEF:out_neg=outgoing,-1,*",
"AREA:incoming#33cc33:$tr{'incoming traffic in bytes per second'}\\j",
"LINE1:incoming#006600",
"AREA:out_neg#ff3333:$tr{'outgoing traffic in bytes per second'}\\j",
"LINE1:out_neg#990000",
"GPRINT:incoming:MAX:$tr{'maximal'} $tr{'in'}\\:%8.3lf %sBps",
"GPRINT:incoming:AVERAGE:$tr{'average'} $tr{'in'}\\:%8.3lf %sBps",
"GPRINT:incoming:LAST:$tr{'current'} $tr{'in'}\\:%8.3lf %sBps\\j",
"GPRINT:outgoing:MAX:$tr{'maximal'} $tr{'out'}\\:%8.3lf %sBps",
"GPRINT:outgoing:AVERAGE:$tr{'average'} $tr{'out'}\\:%8.3lf %sBps",
"GPRINT:outgoing:LAST:$tr{'current'} $tr{'out'}\\:%8.3lf %sBps\\j");
} else {
RRDs::graph ("$graphs/$interface-$period.png",
"--start", "-1$period", "-aPNG", "-i", "-z",
"-w 500", "-h 100",
"--color", "SHADEA#EAE9EE",
"--color", "SHADEB#EAE9EE",
"--color", "BACK#EAE9EE",
"-t $tr{'traffic on'} $interface ($tr{'graph per'} $tr{$period})",
"-v$tr{'bytes per second'}",
"DEF:incoming=$rrdlog/$interface.rrd:incoming:AVERAGE",
"DEF:outgoing=$rrdlog/$interface.rrd:outgoing:AVERAGE",
"CDEF:in_neg=incoming,-1,*",
"AREA:outgoing#33cc33:$tr{'incoming traffic in bytes per second'}\\j",
"LINE1:outgoing#006600",
"AREA:in_neg#ff3333:$tr{'outgoing traffic in bytes per second'}\\j",
"LINE1:in_neg#990000",
"GPRINT:outgoing:MAX:$tr{'maximal'} $tr{'in'}\\:%8.3lf %sBps",
"GPRINT:outgoing:AVERAGE:$tr{'average'} $tr{'in'}\\:%8.3lf %sBps",
"GPRINT:outgoing:LAST:$tr{'current'} $tr{'in'}\\:%8.3lf %sBps\\j",
"GPRINT:incoming:MAX:$tr{'maximal'} $tr{'out'}\\:%8.3lf %sBps",
"GPRINT:incoming:AVERAGE:$tr{'average'} $tr{'out'}\\:%8.3lf %sBps",
"GPRINT:incoming:LAST:$tr{'current'} $tr{'out'}\\:%8.3lf %sBps\\j");
}
$ERROR = RRDs::error;
print "Error in RRD::graph for $interface: $ERROR\n" if $ERROR;
}
Job Done.
This page has been viewed 808 times since Nov 2009 since Nov 2009.
Previous page: Alternate Graph Style
Next page: Bits per second
Print this page