From 81b4fbf22158428bccf9d3315d49654215afd9f8 Mon Sep 17 00:00:00 2001 From: f0o Date: Fri, 2 Oct 2015 02:00:28 +0000 Subject: [PATCH 1/2] Fixes #2037 --- includes/rrdtool.inc.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/includes/rrdtool.inc.php b/includes/rrdtool.inc.php index 1c12f7e39..b846d060e 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,12 @@ function rrdtool($command, $filename, $options) { function rrdtool_create($filename, $options) { + 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)); } From 5fd1f598524dba46c2fe6c50d4e10f8246fb43b7 Mon Sep 17 00:00:00 2001 From: f0o Date: Sat, 3 Oct 2015 16:14:23 +0000 Subject: [PATCH 2/2] Fixup --- includes/rrdtool.inc.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/includes/rrdtool.inc.php b/includes/rrdtool.inc.php index b846d060e..b71eee7a0 100644 --- a/includes/rrdtool.inc.php +++ b/includes/rrdtool.inc.php @@ -206,8 +206,9 @@ function rrdtool($command, $filename, $options) { function rrdtool_create($filename, $options) { + global $config; if( $config['rrdcached'] && $config['rrdtool_version'] >= 1.5 ) { - $chk = rrdtool('info', $filename); + $chk = rrdtool('info', $filename, ''); if (!empty($chk[0])) { return true; }