fix rrdcached (thanks to Mickael Marchand)

git-svn-id: http://www.observium.org/svn/observer/trunk@2505 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2011-09-19 11:09:24 +00:00
parent 45ce1ffdeb
commit 627ed7af09

View File

@@ -7,12 +7,7 @@ function rrdtool_graph($graph_file, $options)
if($debug) { echo("$options"); }
if ($config['rrdcached'])
{
$command = $config['rrdtool'] . " --daemon " . $config['rrdcached'] . " -";
} else {
$command = $config['rrdtool'] . " -";
}
$descriptorspec = array(
0 => array("pipe", "r"), // stdin is a pipe that the child will read from
@@ -31,7 +26,12 @@ function rrdtool_graph($graph_file, $options)
// 1 => readable handle connected to child stdout
// Any error output will be appended to /tmp/error-output.txt
if ($config['rrdcached']) {
fwrite($pipes[0], "graph --daemon " . $config['rrdcached'] . " $graph_file $options");
} else {
fwrite($pipes[0], "graph $graph_file $options");
}
fclose($pipes[0]);
fclose($pipes[1]);