From a78fac6d050d7ec1f900d034920ea62ab3f1f0dd Mon Sep 17 00:00:00 2001 From: Paul Gear Date: Tue, 12 Jan 2016 21:26:42 +1000 Subject: [PATCH] Allow ['rrd_def'] to be array or string --- includes/rrdtool.inc.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/includes/rrdtool.inc.php b/includes/rrdtool.inc.php index c5b9d44978..2edc72f66f 100644 --- a/includes/rrdtool.inc.php +++ b/includes/rrdtool.inc.php @@ -348,8 +348,9 @@ function rrdtool_data_update($device, $measurement, $tags, $fields) $rrd = rrd_name($device['hostname'], $rrd_name); if (!is_file($rrd) && $tags['rrd_def']) { - // add the --step and the rra definitions to the array - $newdef = "--step $step ".implode(' ', $tags['rrd_def']).$config['rrd_rra']; + $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']; rrdtool_create($rrd, $newdef); }