From some digging in code I have found problem RRDs::graph sometimes fails and crashes the perl program part way through generating the frame with the graph in it. Steve has mentioned in a post elsewhere the parameter list is very long and can make RRDs::graph fall over from time to time.
As I am using the latest version of RRDs in perl install I have a newer version to try and avoid problem is not an option....
So I have got around this problem as best as I can now by altering routers2.pl to call the code to regenerate the graph - instead of every time the page is rendered it is now only called if the rrd file has been updated since the graph was last generated (or its zero bytes because something has gone wrong with graph generation last time) :
Search for :
( $rrdoutput, $rrdxsize, $rrdysize ) = RRDs::graph(@params);
$e = RRDs::error();
and replace with :
if ((stat($thisgraph))[7] gt 0 && (stat($thisgraph))[9] gt RRDs::last($interfaces{$graphif}{rrd})) {
close(INFO);
} else {
( $rrdoutput, $rrdxsize, $rrdysize ) = RRDs::graph(@params);
$e = RRDs::error();
}
not perfect but the calls to the problem part of script happen much less now so the chances of having no graph displayed are much lower and its less work for the server to keep generating the graph when the data has not changed so a few watts of power saved too
