From acba0783999a5c9131e02a122759cff3dcc03c5b Mon Sep 17 00:00:00 2001 From: Tom Laermans Date: Thu, 22 Sep 2011 13:39:03 +0000 Subject: [PATCH] fix graph_error function git-svn-id: http://www.observium.org/svn/observer/trunk@2540 61d68cd4-352d-0410-923a-c4978735b2b8 --- html/includes/functions.inc.php | 6 ++++-- html/includes/graphs/graph.inc.php | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/html/includes/functions.inc.php b/html/includes/functions.inc.php index 7613515b17..f058fb0df7 100644 --- a/html/includes/functions.inc.php +++ b/html/includes/functions.inc.php @@ -20,13 +20,15 @@ function rrdtool_graph($graph_file, $options) $process = proc_open($command, $descriptorspec, $pipes, $cwd, $env); - if (is_resource($process)) { + if (is_resource($process)) + { // $pipes now looks like this: // 0 => writeable handle connected to child stdin // 1 => readable handle connected to child stdout // Any error output will be appended to /tmp/error-output.txt - if ($config['rrdcached']) { + if ($config['rrdcached']) + { fwrite($pipes[0], "graph --daemon " . $config['rrdcached'] . " $graph_file $options"); } else { fwrite($pipes[0], "graph $graph_file $options"); diff --git a/html/includes/graphs/graph.inc.php b/html/includes/graphs/graph.inc.php index dcaae7233b..9247f9d454 100644 --- a/html/includes/graphs/graph.inc.php +++ b/html/includes/graphs/graph.inc.php @@ -36,6 +36,8 @@ $vertical = mres($_GET['vertical']); $legend = mres($_GET['legend']); $id = mres($_GET['id']); +$graphfile = $config['temp_dir'] . "/" . strgen() . ".png"; + if (isset($config['allow_unauth_graphs']) && $config['allow_unauth_graphs']) { $auth = "1"; ## hardcode auth for all with config function @@ -54,8 +56,6 @@ $subtype = $graphtype['subtype']; if ($debug) {print_r($graphtype); } -$graphfile = $config['temp_dir'] . "/" . strgen() . ".png"; - if (is_file($config['install_dir'] . "/html/includes/graphs/$type/$subtype.inc.php")) { if (isset($config['allow_unauth_graphs_cidr']) && count($config['allow_unauth_graphs_cidr']) > 0)