Previous page: Alternate Graph Style
Next page: Bits per second

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'.

new graph

  1. Here is the replacement updateifgraph procedure
    sub updateifgraph {
    my $interface = $_[0];
    my $period    = $_[1];
    # EAK =>
    if ($interface eq "RED") {
    # => EAK
    RRDs::graph ("$graphs/$interface-$period.png",
    "--start", "-1$period", "-aPNG", "-i", "-z",
    "--alt-y-grid", "-w 600", "-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",
    # EAK <=
    "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",
    #"AREA:incoming#00FF00:$tr{'incoming traffic in bytes per second'}\\j",
    #"LINE1:outgoing#0000FF:$tr{'outgoing traffic in bytes per second'}\\j",
    # => EAK
    "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");
    # EAK =>
    } else {
    RRDs::graph ("$graphs/$interface-$period.png",
    "--start", "-1$period", "-aPNG", "-i", "-z",
    "-w 600", "-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");
    }
    # => EAK
    $ERROR = RRDs::error;
    print "Error in RRD::graph for $interface: $ERROR\n" if $ERROR;
    }

Job Done.


^Top
Previous page: Alternate Graph Style
Next page: Bits per second