![]() |
News | Profile | Code | Photography | Looking Glass | Projects | System Statistics | Uncategorized |
Blog |
You know me, I'm fairly old-school, so I use MRTG for all network monitoring. Although I converted to RRDtool (rateup sucks) awhile back, I've still been sticking with the classic MRTG look via the mrtg-rrd CGI script.
FreeBSD ports upgraded RRDtool to 1.3.0 recently, and ended up breaking mrtg-rrd. The mrtg-rrd page looked like this:
It turned out the width and height (classic ol' HTML) parameters to the image tag were wrong. width was being set to 8 or 0, and height was being set to an outrageously large number. The image itself was intact, though. mrtg-rrd was populating these values from the 2nd and 3rd array indices of the return value from RRDs::graph, $rv[0] and $rv[1]:
my @rv = RRDs::graph($file, '-s', "-$back", @local_args, @{$target->{args}}, "VRULE:$oldsec#ff0000", "VRULE:$seconds#ff0000", @local_args_end);
Bug in RRDtool? Maybe. Could be something that RRDtool linked against. Anyway, the workaround is easy since the width and height are available from the config:
@@ -230,8 +230,8 @@ return unless defined $tgt->{$ext}; my @values = @{$params->[0]}; - my $x = $params->[1]; - my $y = $params->[2]; + my $x = $tgt->{config}->{xsize}; + my $y = $tgt->{config}->{ysize}; $x *= $tgt->{xzoom} if defined $tgt->{xzoom}; $y *= $tgt->{yzoom} if defined $tgt->{yzoom};
Now graphs are looking better, again.
So, I have MRTG and RRDTool installed on a new Fedora 10 system and RRDTool seems to be broken on it, too. I don't get the values under the graphs but only every 5 minutes or so. Anyone else having this problem? Stems from RRDs::graph not returning the data but only so often.
Yeah, I get that too. I'm not sure why it's doing that, I honestly haven't looked into it too much...
New comments are currently disabled for this entry.
![]() ![]() ![]() ![]() ![]() |
This HTML for this page was generated in 0.001 seconds. |
Thanks, this was extremely helpful!