Always send rrd create

This commit is contained in:
Tony Murray
2016-08-06 23:53:26 -05:00
parent 668c08193e
commit 837e360d5f
+2 -2
View File
@@ -229,7 +229,7 @@ function rrdtool_check_rrd_exists($filename)
{
global $config;
if ($config['rrdcached'] && version_compare($config['rrdtool_version'], '1.5', '>=')) {
$chk = rrdtool('last', $filename, '', 10); // wait up to 10 seconds
$chk = rrdtool('last', $filename, '', 30); // wait up to 30 seconds
return strpos(implode($chk), "$filename': No such file or directory") === false;
} else {
return is_file($filename);
@@ -378,7 +378,7 @@ function rrdtool_data_update($device, $measurement, $tags, $fields)
}
$rrd = rrd_name($device['hostname'], $rrd_name);
if (!rrdtool_check_rrd_exists($rrd) && $tags['rrd_def']) {
if ($tags['rrd_def']) {
$rrd_def = is_array($tags['rrd_def']) ? $tags['rrd_def'] : array($tags['rrd_def']);
// add the --step and the rra definitions to the command
$newdef = "--step $step ".implode(' ', $rrd_def).$config['rrd_rra'];