--- experimental/reports/graphing/graph.pl 2002/03/09 19:53:24 1.1 +++ experimental/reports/graphing/graph.pl 2002/03/10 03:07:08 1.2 @@ -7,7 +7,7 @@ # Generates graphs from rrd databases for i-scream data. # # $Author: tdb $ -# $Id: graph.pl,v 1.1 2002/03/09 19:53:24 tdb Exp $ +# $Id: graph.pl,v 1.2 2002/03/10 03:07:08 tdb Exp $ #------------------------------------------------------------ ## TODO @@ -109,11 +109,11 @@ foreach my $machine (@rrddirlist) { my($baserrd) = $1; my($i) = 0; while( -f "$rrddir/$machine/$baserrd\_$i.rrd" ) { - push @data, "LINE2:$baserrd\_$i:size" . &get_colour($i) . ":queue$i size "; + push @data, "LINE2:$baserrd\_$i:size$i" . &get_colour($i) . ":queue$i size "; ++$i; } push @data, "LINE2:$baserrd\_0:total#FF0000:packets/sec - currently"; - push @rawdata, "GPRINT:total:LAST:\"%lf %spackets/sec\""; + push @rawdata, "GPRINT:total:LAST:%lf %spackets/sec"; my($comment); if(-f "$rrddir/$machine/$baserrd.def") { open(DEF, "$rrddir/$machine/$baserrd.def"); @@ -140,6 +140,7 @@ foreach my $machine (@rrddirlist) { # $rawcmdref = a reference to an array containing raw rrd commands # elements a single command each, no spaces # + sub makegraph() { my($machine, $type, $title, $dataref, $rawcmdref) = @_; # pass in these arrays by reference @@ -165,16 +166,16 @@ sub makegraph() { push @rrdcmd, @rawcmd; RRDs::graph ("$imgdir/$machine/$type-3h.png", "--start=-10800", @rrdcmd); my($err_3h) = RRDs::error; - print STDERR "Error generating 3h graph for $machine\_$type: $err_3h\n" if $err_3h; + print STDERR "Error generating 3h graph for $machine/$type: $err_3h\n" if $err_3h; RRDs::graph ("$imgdir/$machine/$type-1d.png", "--start=-86400", @rrdcmd); my($err_1d) = RRDs::error; - print STDERR "Error generating 1d graph for $machine\_$type: $err_1d\n" if $err_1d; + print STDERR "Error generating 1d graph for $machine/$type: $err_1d\n" if $err_1d; RRDs::graph ("$imgdir/$machine/$type-1w.png", "--start=-604800", @rrdcmd); my($err_1w) = RRDs::error; - print STDERR "Error generating 1w graph for $machine\_$type: $err_1w\n" if $err_1w; + print STDERR "Error generating 1w graph for $machine/$type: $err_1w\n" if $err_1w; RRDs::graph ("$imgdir/$machine/$type-1m.png", "--start=-2678400", @rrdcmd); my($err_1m) = RRDs::error; - print STDERR "Error generating 1m graph for $machine\_$type: $err_1m\n" if $err_1m; + print STDERR "Error generating 1m graph for $machine/$type: $err_1m\n" if $err_1m; return; }