Previous page: Flow wrt Red
Next page: Reduced Graph Width

Bits per second

Tested on: 1.4.21

The default graphs display in bytes per second.   If you want to see this information in bits per second, then this is what you need...

new graph
  1. In /usr/local/bin/makegraphs replace updateifgraph with the following:

    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 600", "-h 100",
    "--color", "SHADEA#EAE9EE",
    "--color", "SHADEB#EAE9EE",
    "--color", "BACK#EAE9EE",
    "-t $tr{'traffic on'} $interface ($tr{'graph per'} $tr{$period})",
    "-v", "bits per second (bps)",
    "DEF:incoming=$rrdlog/$interface.rrd:incoming:AVERAGE",
    "DEF:outgoing=$rrdlog/$interface.rrd:outgoing:AVERAGE",
    "CDEF:out_neg=outgoing,-1,*,8,*",
    "CDEF:out_bits=outgoing,8,*",
    "CDEF:in_bits=incoming,8,*",
    "AREA:in_bits#33cc33:incoming traffic in bits per second\\j",
    "LINE1:in_bits#006600",
    "AREA:out_neg#ff3333:outgoing traffic in bits per second\\j",
    "LINE1:out_neg#990000",
    "GPRINT:in_bits:MAX:$tr{'maximal'} $tr{'in'}\\:%8.3lf %sbps",
    "GPRINT:in_bits:AVERAGE:$tr{'average'} $tr{'in'}\\:%8.3lf %sbps",
    "GPRINT:in_bits:LAST:$tr{'current'} $tr{'in'}\\:%8.3lf %sbps\\j",
    "GPRINT:out_bits:MAX:$tr{'maximal'} $tr{'out'}\\:%8.3lf %sbps",
    "GPRINT:out_bits:AVERAGE:$tr{'average'} $tr{'out'}\\:%8.3lf %sbps",
    "GPRINT:out_bits:LAST:$tr{'current'} $tr{'out'}\\:%8.3lf %sbps\\j");
    } 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", "bits per second (bps)",
    "DEF:incoming=$rrdlog/$interface.rrd:incoming:AVERAGE",
    "DEF:outgoing=$rrdlog/$interface.rrd:outgoing:AVERAGE",
    "CDEF:in_neg=incoming,-1,*,8,*",
    "CDEF:in_bits=incoming,8,*",
    "CDEF:out_bits=outgoing,8,*",
    "AREA:out_bits#33cc33:incoming traffic in bits per second\\j",
    "LINE1:out_bits#006600",
    "AREA:in_neg#ff3333:outgoing traffic in bits per second\\j",
    "LINE1:in_neg#990000",
    "GPRINT:out_bits:MAX:$tr{'maximal'} $tr{'in'}\\:%8.3lf %sbps",
    "GPRINT:out_bits:AVERAGE:$tr{'average'} $tr{'in'}\\:%8.3lf %sbps",
    "GPRINT:out_bits:LAST:$tr{'current'} $tr{'in'}\\:%8.3lf %sbps\\j",
    "GPRINT:in_bits:MAX:$tr{'maximal'} $tr{'out'}\\:%8.3lf %sbps",
    "GPRINT:in_bits:AVERAGE:$tr{'average'} $tr{'out'}\\:%8.3lf %sbps",
    "GPRINT:in_bits: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.


^Top
Previous page: Flow wrt Red