Commit e964915c authored by Franco Fichtner's avatar Franco Fichtner

status/rrd: trying to pin down #113

parent 7e1a1a10
...@@ -526,7 +526,7 @@ function get_dates($curperiod, $graph) { ...@@ -526,7 +526,7 @@ function get_dates($curperiod, $graph) {
echo "<tr><td colspan=\"100%\" class=\"list\">\n"; echo "<tr><td colspan=\"100%\" class=\"list\">\n";
echo "<img border=\"0\" width=\"100%;\" name=\"{$id}\""; echo "<img border=\"0\" width=\"100%;\" name=\"{$id}\"";
echo "id=\"{$id}\" alt=\"$prettydb Graph\" "; 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 "<br /><hr /><br />\n";
echo "</td></tr>\n"; echo "</td></tr>\n";
} }
...@@ -595,7 +595,7 @@ function get_dates($curperiod, $graph) { ...@@ -595,7 +595,7 @@ function get_dates($curperiod, $graph) {
echo "<tr><td colspan=\"100%\" class=\"list\">\n"; echo "<tr><td colspan=\"100%\" class=\"list\">\n";
echo "<img border=\"0\" width=\"100%;\" name=\"{$id}\" "; echo "<img border=\"0\" width=\"100%;\" name=\"{$id}\" ";
echo "id=\"{$id}\" alt=\"$prettydb Graph\" "; 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 "<br /><hr /><br />\n";
echo "</td></tr>\n"; echo "</td></tr>\n";
} }
......
...@@ -1217,18 +1217,20 @@ else { ...@@ -1217,18 +1217,20 @@ else {
/* check modification time to see if we need to generate image */ /* check modification time to see if we need to generate image */
if (file_exists("$rrdtmppath$curdatabase-$curgraph.png")) { if (file_exists("$rrdtmppath$curdatabase-$curgraph.png")) {
if((time() - filemtime("$rrdtmppath$curdatabase-$curgraph.png")) >= 15 ) { if((time() - filemtime("$rrdtmppath$curdatabase-$curgraph.png")) >= 15 ) {
if($data) if ($data) {
$_gb = exec("$graphcmd 2>&1", $graphcmdoutput, $graphcmdreturn); $_gb = exec("$graphcmd 2>&1", $graphcmdoutput, $graphcmdreturn);
$graphcmdoutput = implode(" ", $graphcmdoutput) . $graphcmd; $graphcmdoutput = implode(" ", $graphcmdoutput) . $graphcmd;
flush(); flush();
usleep(500); usleep(500);
}
} }
} else { } else {
if($data) if ($data) {
$_gb = exec("$graphcmd 2>&1", $graphcmdoutput, $graphcmdreturn); $_gb = exec("$graphcmd 2>&1", $graphcmdoutput, $graphcmdreturn);
$graphcmdoutput = implode(" ", $graphcmdoutput) . $graphcmd; $graphcmdoutput = implode(" ", $graphcmdoutput) . $graphcmd;
flush(); flush();
usleep(500); usleep(500);
}
} }
if(($graphcmdreturn <> 0) || (! $data)) { if(($graphcmdreturn <> 0) || (! $data)) {
log_error(sprintf(gettext('Failed to create graph with error code %1$s, the error is: %2$s'),$graphcmdreturn,$graphcmdoutput)); log_error(sprintf(gettext('Failed to create graph with error code %1$s, the error is: %2$s'),$graphcmdreturn,$graphcmdoutput));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment