109 |
|
my($baserrd) = $1; |
110 |
|
my($i) = 0; |
111 |
|
while( -f "$rrddir/$machine/$baserrd\_$i.rrd" ) { |
112 |
< |
push @data, "LINE2:$baserrd\_$i:size" . &get_colour($i) . ":queue$i size "; |
112 |
> |
push @data, "LINE2:$baserrd\_$i:size$i" . &get_colour($i) . ":queue$i size "; |
113 |
|
++$i; |
114 |
|
} |
115 |
|
push @data, "LINE2:$baserrd\_0:total#FF0000:packets/sec - currently"; |
116 |
< |
push @rawdata, "GPRINT:total:LAST:\"%lf %spackets/sec\""; |
116 |
> |
push @rawdata, "GPRINT:total:LAST:%lf %spackets/sec"; |
117 |
|
my($comment); |
118 |
|
if(-f "$rrddir/$machine/$baserrd.def") { |
119 |
|
open(DEF, "$rrddir/$machine/$baserrd.def"); |
140 |
|
# $rawcmdref = a reference to an array containing raw rrd commands |
141 |
|
# elements a single command each, no spaces |
142 |
|
# |
143 |
+ |
|
144 |
|
sub makegraph() { |
145 |
|
my($machine, $type, $title, $dataref, $rawcmdref) = @_; |
146 |
|
# pass in these arrays by reference |
166 |
|
push @rrdcmd, @rawcmd; |
167 |
|
RRDs::graph ("$imgdir/$machine/$type-3h.png", "--start=-10800", @rrdcmd); |
168 |
|
my($err_3h) = RRDs::error; |
169 |
< |
print STDERR "Error generating 3h graph for $machine\_$type: $err_3h\n" if $err_3h; |
169 |
> |
print STDERR "Error generating 3h graph for $machine/$type: $err_3h\n" if $err_3h; |
170 |
|
RRDs::graph ("$imgdir/$machine/$type-1d.png", "--start=-86400", @rrdcmd); |
171 |
|
my($err_1d) = RRDs::error; |
172 |
< |
print STDERR "Error generating 1d graph for $machine\_$type: $err_1d\n" if $err_1d; |
172 |
> |
print STDERR "Error generating 1d graph for $machine/$type: $err_1d\n" if $err_1d; |
173 |
|
RRDs::graph ("$imgdir/$machine/$type-1w.png", "--start=-604800", @rrdcmd); |
174 |
|
my($err_1w) = RRDs::error; |
175 |
< |
print STDERR "Error generating 1w graph for $machine\_$type: $err_1w\n" if $err_1w; |
175 |
> |
print STDERR "Error generating 1w graph for $machine/$type: $err_1w\n" if $err_1w; |
176 |
|
RRDs::graph ("$imgdir/$machine/$type-1m.png", "--start=-2678400", @rrdcmd); |
177 |
|
my($err_1m) = RRDs::error; |
178 |
< |
print STDERR "Error generating 1m graph for $machine\_$type: $err_1m\n" if $err_1m; |
178 |
> |
print STDERR "Error generating 1m graph for $machine/$type: $err_1m\n" if $err_1m; |
179 |
|
return; |
180 |
|
} |
181 |
|
|