status/rrd: trying to pin down #113

This commit is contained in:
Franco Fichtner 2015-04-22 18:32:01 +02:00
parent 7e1a1a106c
commit e964915cab
2 changed files with 6 additions and 4 deletions

View File

@ -526,7 +526,7 @@ function get_dates($curperiod, $graph) {
echo "<tr><td colspan=\"100%\" class=\"list\">\n";
echo "<img border=\"0\" width=\"100%;\" name=\"{$id}\"";
echo "id=\"{$id}\" alt=\"$prettydb Graph\" ";
echo "src=\"status_rrd_graph_img.php?start={$start}&amp;end={$end}&amp;database={$curdatabase}&amp;style={$curstyle}&amp;graph={$graph}?refresh_date={$img_date}\" />\n";
echo "src=\"status_rrd_graph_img.php?start={$start}&amp;end={$end}&amp;database={$curdatabase}&amp;style={$curstyle}&amp;graph={$graph}-{$img_date}\" />\n";
echo "<br /><hr /><br />\n";
echo "</td></tr>\n";
}
@ -595,7 +595,7 @@ function get_dates($curperiod, $graph) {
echo "<tr><td colspan=\"100%\" class=\"list\">\n";
echo "<img border=\"0\" width=\"100%;\" name=\"{$id}\" ";
echo "id=\"{$id}\" alt=\"$prettydb Graph\" ";
echo "src=\"status_rrd_graph_img.php?start={$start}&amp;end={$end}&amp;database={$curdatabase}&amp;style={$curstyle}&amp;graph={$graph}?refresh_date={$img_date}\" />\n";
echo "src=\"status_rrd_graph_img.php?start={$start}&amp;end={$end}&amp;database={$curdatabase}&amp;style={$curstyle}&amp;graph={$graph}-{$img_date}\" />\n";
echo "<br /><hr /><br />\n";
echo "</td></tr>\n";
}

View File

@ -1217,18 +1217,20 @@ else {
/* check modification time to see if we need to generate image */
if (file_exists("$rrdtmppath$curdatabase-$curgraph.png")) {
if((time() - filemtime("$rrdtmppath$curdatabase-$curgraph.png")) >= 15 ) {
if($data)
if ($data) {
$_gb = exec("$graphcmd 2>&1", $graphcmdoutput, $graphcmdreturn);
$graphcmdoutput = implode(" ", $graphcmdoutput) . $graphcmd;
flush();
usleep(500);
}
}
} else {
if($data)
if ($data) {
$_gb = exec("$graphcmd 2>&1", $graphcmdoutput, $graphcmdreturn);
$graphcmdoutput = implode(" ", $graphcmdoutput) . $graphcmd;
flush();
usleep(500);
}
}
if(($graphcmdreturn <> 0) || (! $data)) {
log_error(sprintf(gettext('Failed to create graph with error code %1$s, the error is: %2$s'),$graphcmdreturn,$graphcmdoutput));