From 5c6e4995ab46930cfaf95ddf7d4fb811696ebf02 Mon Sep 17 00:00:00 2001 From: laf Date: Sun, 28 Jun 2015 16:25:20 +0100 Subject: [PATCH 1/3] Updated regex for device groups --- html/forms/parse-device-group.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html/forms/parse-device-group.inc.php b/html/forms/parse-device-group.inc.php index 7009459f2..9ecd4e52e 100644 --- a/html/forms/parse-device-group.inc.php +++ b/html/forms/parse-device-group.inc.php @@ -20,7 +20,7 @@ $group_id = $_POST['group_id']; if(is_numeric($group_id) && $group_id > 0) { $group = dbFetchRow("SELECT * FROM `device_groups` WHERE `id` = ? LIMIT 1",array($group_id)); - $group_split = preg_split('/([a-zA-Z0-9_\-\.\=\%\<\>\ \"\'\!\~\(\)\*\/\@]+[&&\|\|]+)/',$group['pattern'], -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); + $group_split = preg_split('/([a-zA-Z0-9_\-\.\=\%\<\>\ \"\'\!\~\(\)\*\/\@\[\]]+[&&\|\|]+)/',$group['pattern'], -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); $count = count($group_split) - 1; $group_split[$count] = $group_split[$count].' &&'; $output = array('name'=>$group['name'],'desc'=>$group['desc'],'pattern'=>$group_split); From a7d83be1af6807269dcc1da9c8a45ed4a54c8392 Mon Sep 17 00:00:00 2001 From: laf Date: Tue, 30 Jun 2015 10:48:08 +0100 Subject: [PATCH 2/3] Fixed API graphs not loading --- html/includes/graphs/graph.inc.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/html/includes/graphs/graph.inc.php b/html/includes/graphs/graph.inc.php index 5c6bfe1c1..6ba9de57a 100644 --- a/html/includes/graphs/graph.inc.php +++ b/html/includes/graphs/graph.inc.php @@ -38,7 +38,9 @@ $graphfile = $config['temp_dir'] . "/" . strgen() . ".png"; $type = $graphtype['type']; $subtype = $graphtype['subtype']; -$auth = is_client_authorized($_SERVER['REMOTE_ADDR']); +if ($auth !== true && $auth != 1) { + $auth = is_client_authorized($_SERVER['REMOTE_ADDR']); +} include($config['install_dir'] . "/html/includes/graphs/$type/auth.inc.php"); if ($auth === true && is_file($config['install_dir'] . "/html/includes/graphs/$type/$subtype.inc.php")) { From b92e9f2d8f1ab01b702342de25c951ef899b4109 Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Tue, 30 Jun 2015 07:46:09 -0400 Subject: [PATCH 3/3] Update to the freqency DS used in collectd > 5.0 Similar to #1347 and #1349 --- html/includes/collectd/definitions.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/html/includes/collectd/definitions.php b/html/includes/collectd/definitions.php index 6e1269c90..e93e35cfd 100644 --- a/html/includes/collectd/definitions.php +++ b/html/includes/collectd/definitions.php @@ -422,9 +422,9 @@ function load_graph_definitions($logarithmic = false, $tinylegend = false) { 'GPRINT:avg:LAST:%4.1lf\l'); $GraphDefs['frequency'] = array( #'-v', 'Hertz', - 'DEF:avg={file}:frequency:AVERAGE', - 'DEF:min={file}:frequency:MIN', - 'DEF:max={file}:frequency:MAX', + 'DEF:avg={file}:value:AVERAGE', + 'DEF:min={file}:value:MIN', + 'DEF:max={file}:value:MAX', "AREA:max#b5b5b5", "AREA:min#$Canvas", "LINE1:avg#$FullBlue:Frequency [Hz]",