Index: ossp-pkg/flow2rrd/ChangeLog RCS File: /v/ossp/cvs/ossp-pkg/flow2rrd/ChangeLog,v rcsdiff -q -kk '-r1.8' '-r1.9' -u '/v/ossp/cvs/ossp-pkg/flow2rrd/ChangeLog,v' 2>/dev/null --- ChangeLog 2004/12/27 13:06:19 1.8 +++ ChangeLog 2004/12/27 15:58:23 1.9 @@ -10,6 +10,15 @@ Changes between 0.9.1 and 0.9.2 (26-Dec-2004 to 27-Dec-2004): + *) Reduce color-reduction for incoming traffic to not underflow too + fast and render the incoming/outgoing legend more as a table. + Also, the MGRIDs are now drawn less black and the day borders are + drawn fully black. + [Ralf S. Engelschall] + + *) Remove out-commented code. + [Ralf S. Engelschall] + *) Match flows against targets in the same order the targets occur in the configuration file to allow overlapping networks (where the first matching one is taken). Index: ossp-pkg/flow2rrd/flow2rrd.pl RCS File: /v/ossp/cvs/ossp-pkg/flow2rrd/flow2rrd.pl,v rcsdiff -q -kk '-r1.12' '-r1.13' -u '/v/ossp/cvs/ossp-pkg/flow2rrd/flow2rrd.pl,v' 2>/dev/null --- flow2rrd.pl 2004/12/27 13:06:19 1.12 +++ flow2rrd.pl 2004/12/27 15:58:23 1.13 @@ -358,14 +358,6 @@ sub data_accumulate { my ($cfg, $ctx) = @_; - #my $st = POSIX::ctime($Cflow::startime); $st =~ s/\r?\n$//s; - #my $et = POSIX::ctime($Cflow::endtime); $et =~ s/\r?\n$//s; - #printf(STDERR "%s %15.15s.%-5hu %15.15s.%-5hu %2hu %3u %u\n", - # $et, - # $Cflow::srcip, $Cflow::srcport, - # $Cflow::dstip, $Cflow::dstport, - # $Cflow::protocol, $Cflow::bytes); - # iterate over all target and services to see whether # the flow matches them... my $matched_total = 0; @@ -569,12 +561,19 @@ push(@cdef, sprintf("CDEF:data%d_o=%s", $i, $cdef_o)); push(@cdef, sprintf("CDEF:data%d_i=%s", $i, $cdef_i)); my $color_o; eval "\$color_o = 0x".$colors->[$i]; - my $color_i; eval "\$color_i = \$color_o - 0x404040"; - push(@draw_o, sprintf("%s:data%d_o#%06x:%s out", ($i == 0 ? "AREA" : "STACK"), $i, $color_o, $target)); - push(@draw_i, sprintf("%s:data%d_i#%06x:%s in", ($i == 0 ? "AREA" : "STACK"), $i, $color_i, $target)); + my $color_i; eval "\$color_i = \$color_o - 0x101010"; + push(@draw_o, sprintf("%s:data%d_o#%06x:out %s", ($i == 0 ? "AREA" : "STACK"), $i, $color_o, $target)); + push(@draw_i, sprintf("%s:data%d_i#%06x:in %s", ($i == 0 ? "AREA" : "STACK"), $i, $color_i, $target)); $i++; } - my @draw = (@draw_o, "COMMENT:\n", @draw_i, "HRULE:0#000000"); + my @draw = (@draw_o, 'COMMENT:\n', @draw_i); + push(@draw, "HRULE:0#000000"); + my $ts = int(($graph->{-graph_start} / (24*60*60)) + 0) * (24*60*60); + my $te = int(($graph->{-graph_end} / (24*60*60)) + 1) * (24*60*60); + for (my $t = $ts; $t < $te; $t += (12*60*60)) { + if (($t % (24*60*60)) == 0) { push(@draw, "VRULE:$t#000000"); } + else { push(@draw, "VRULE:$t#999999"); } + } my @args = (); push(@args, $graph->{-img_file}); push(@args, '--imgformat', $graph->{-img_format}); @@ -585,7 +584,7 @@ push(@args, '--upper-limit', $graph->{-graph_ulimit}) if ($graph->{-graph_ulimit} != 0); push(@args, '--lower-limit', $graph->{-graph_llimit}) if ($graph->{-graph_llimit} != 0); push(@args, '--rigid'); - push(@args, '--alt-autoscale',); + push(@args, '--alt-autoscale'); push(@args, '--base', 1024); push(@args, '--x-grid', "HOUR:1:DAY:1:DAY:1:0:%d-%b-%Y"); push(@args, '--vertical-label', 'Bit/s'); @@ -594,7 +593,7 @@ push(@args, '--color', 'SHADEA#e5e5f5'); push(@args, '--color', 'SHADEB#d0d0e0'); push(@args, '--color', 'GRID#cccccc'); - push(@args, '--color', 'MGRID#000000'); + push(@args, '--color', 'MGRID#999999'); push(@args, '--color', 'FONT#000000'); push(@args, '--color', 'FRAME#000000'); push(@args, '--color', 'ARROW#000000'); @@ -648,12 +647,19 @@ push(@cdef, sprintf("CDEF:data%d_o=%s_o,8,*,+1,*", $i, $ds_name)); push(@cdef, sprintf("CDEF:data%d_i=%s_i,8,*,-1,*", $i, $ds_name)); my $color_o; eval "\$color_o = 0x".$colors->[$i]; - my $color_i; eval "\$color_i = \$color_o - 0x404040"; - push(@draw_o, sprintf("%s:data%d_o#%06x:%s out", ($i == 0 ? "AREA" : "STACK"), $i, $color_o, $service)); - push(@draw_i, sprintf("%s:data%d_i#%06x:%s in", ($i == 0 ? "AREA" : "STACK"), $i, $color_i, $service)); + my $color_i; eval "\$color_i = \$color_o - 0x101010"; + push(@draw_o, sprintf("%s:data%d_o#%06x:out %s", ($i == 0 ? "AREA" : "STACK"), $i, $color_o, $service)); + push(@draw_i, sprintf("%s:data%d_i#%06x:in %s", ($i == 0 ? "AREA" : "STACK"), $i, $color_i, $service)); $i++; } - my @draw = (@draw_o, "COMMENT:\n", @draw_i, "HRULE:0#000000"); + my @draw = (@draw_o, 'COMMENT:\n', @draw_i); + push(@draw, "HRULE:0#000000"); + my $ts = int(($graph->{-graph_start} / (24*60*60)) + 0) * (24*60*60); + my $te = int(($graph->{-graph_end} / (24*60*60)) + 1) * (24*60*60); + for (my $t = $ts; $t < $te; $t += (12*60*60)) { + if (($t % (24*60*60)) == 0) { push(@draw, "VRULE:$t#000000"); } + else { push(@draw, "VRULE:$t#999999"); } + } my @args = (); push(@args, $graph->{-img_file}); push(@args, '--imgformat', $graph->{-img_format}); @@ -664,7 +670,7 @@ push(@args, '--upper-limit', $graph->{-graph_ulimit}) if ($graph->{-graph_ulimit} != 0); push(@args, '--lower-limit', $graph->{-graph_llimit}) if ($graph->{-graph_llimit} != 0); push(@args, '--rigid'); - push(@args, '--alt-autoscale',); + push(@args, '--alt-autoscale'); push(@args, '--base', 1024); push(@args, '--x-grid', "HOUR:1:DAY:1:DAY:1:0:%d-%b-%Y"); push(@args, '--vertical-label', 'Bit/s'); @@ -673,7 +679,7 @@ push(@args, '--color', 'SHADEA#e5e5f5'); push(@args, '--color', 'SHADEB#d0d0e0'); push(@args, '--color', 'GRID#cccccc'); - push(@args, '--color', 'MGRID#000000'); + push(@args, '--color', 'MGRID#999999'); push(@args, '--color', 'FONT#000000'); push(@args, '--color', 'FRAME#000000'); push(@args, '--color', 'ARROW#000000');