--- projects/cms/source/reports/rrdgraphing/graph.pl 2005/06/15 15:39:24 1.18 +++ projects/cms/source/reports/rrdgraphing/graph.pl 2006/11/23 16:37:44 1.20 @@ -27,7 +27,7 @@ # Generates graphs from rrd databases for i-scream data. # # $Author: tdb $ -# $Id: graph.pl,v 1.18 2005/06/15 15:39:24 tdb Exp $ +# $Id: graph.pl,v 1.20 2006/11/23 16:37:44 tdb Exp $ #------------------------------------------------------------ ## TODO @@ -35,7 +35,7 @@ # -- allow configurable periods of graphs # -- comments, types, etc -my($version) = '$Id: graph.pl,v 1.18 2005/06/15 15:39:24 tdb Exp $'; +my($version) = '$Id: graph.pl,v 1.20 2006/11/23 16:37:44 tdb Exp $'; $| = 1; @@ -46,10 +46,10 @@ use RRDs; # define variables that will be read from the config # nb. keep this insync with the config file! use vars qw{ - $imgdir $rrddir + $imgdir $imgwidth $imgheight $rrddir $maxrrdage $maximgage $deleterrds $deleteimgs $hex_slash $hex_underscore $hex_space $hex_colon $hex_bslash $hex_rbracket - $hex_lbracket $hex_plus + $hex_lbracket $hex_plus $hex_hash $rrdstep $retry_wait $verbose $quiet }; @@ -287,6 +287,7 @@ foreach my $machine (@rrddirlist) { $nicename =~ s/$hex_lbracket/(/g; $nicename =~ s/$hex_rbracket/)/g; $nicename =~ s/$hex_plus/+/g; + $nicename =~ s/$hex_hash/#/g; &makegraph($machine, "$type-$name", "Network IO for $machine on $nicename", "bytes per second", \@data, \@rawdata); } if($rrd =~ /^(mailq)-(\S+)\.rrd$/) { @@ -423,6 +424,8 @@ sub makegraph() { push @rrdcmd, "--imgformat=PNG"; push @rrdcmd, "--lower-limit=0"; push @rrdcmd, "--vertical-label=$vlabel"; + push @rrdcmd, "--width=$imgwidth"; + push @rrdcmd, "--height=$imgheight"; # not entirely convinced this is good... push @rrdcmd, "--alt-autoscale-max"; # add any further raw commands