From 832cbb54f1d60c53f37012073b1c09263006cd91 Mon Sep 17 00:00:00 2001 From: Pim van den Berg Date: Thu, 24 Jul 2014 00:10:57 +0200 Subject: inc/collectd: get_host_rrd_files: filter non-plugin .rrd files Closes #92 --- inc/collectd.inc.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'inc') diff --git a/inc/collectd.inc.php b/inc/collectd.inc.php index 761f7c4..201d8ce 100644 --- a/inc/collectd.inc.php +++ b/inc/collectd.inc.php @@ -33,7 +33,10 @@ function get_host_rrd_files($dir) { '/\.rrd$/'); foreach($objects as $object) { - $files[] = str_replace($dir.'/', '', $object->getPathname()); + $relativePathName = str_replace($dir.'/', '', $object->getPathname()); + if (!preg_match('/^.+\/.+\.rrd$/', $relativePathName)) + continue; + $files[] = $relativePathName; } return $files; -- cgit v1.1