diff --git a/includes/rrdtool.inc.php b/includes/rrdtool.inc.php index 1c12f7e39..b71eee7a0 100644 --- a/includes/rrdtool.inc.php +++ b/includes/rrdtool.inc.php @@ -191,7 +191,7 @@ function rrdtool($command, $filename, $options) { print $console_color->convert('RRD[%g'.$cmd.'%n] '); } else { - $tmp = stream_get_contents($rrd_pipes[1]).stream_get_contents($rrd_pipes[2]); + return array(stream_get_contents($rrd_pipes[1]),stream_get_contents($rrd_pipes[2])); } } @@ -206,6 +206,13 @@ function rrdtool($command, $filename, $options) { function rrdtool_create($filename, $options) { + global $config; + if( $config['rrdcached'] && $config['rrdtool_version'] >= 1.5 ) { + $chk = rrdtool('info', $filename, ''); + if (!empty($chk[0])) { + return true; + } + } return rrdtool('create', $filename, str_replace(array("\r", "\n"), '', $options)); }