Do not attempt to create file if there are no DS definitions

This commit is contained in:
Paul Gear
2015-06-13 15:22:43 +10:00
parent c5c0c1f0a0
commit 96bee67394
+1 -1
View File
@@ -359,7 +359,7 @@ function rrd_create_update($device, $name, $def, $val, $step = 300)
global $config;
$rrd = implode("/", array($config['rrd_dir'], $device['hostname'], safename(implode("-", $name)).".rrd"));
if (!is_file($rrd)) {
if (!is_file($rrd) && $def != null) {
// add the --step and the rra definitions to the array
$newdef = "--step $step ".implode(' ', $def).$config['rrd_rra'];
d_echo("Creating RRD $rrd: $newdef");