From abe8eac1a94e0a149ce6ff782deb11a840e5b125 Mon Sep 17 00:00:00 2001 From: robert Date: Wed, 18 May 2005 21:55:18 +0000 Subject: [PATCH] allow to magically find files if they're named .rrd --- include/classes/rrdstat.php-class | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/include/classes/rrdstat.php-class b/include/classes/rrdstat.php-class index ff14445..680516c 100644 --- a/include/classes/rrdstat.php-class +++ b/include/classes/rrdstat.php-class @@ -68,11 +68,15 @@ class rrdstat { $this->rrd_file = $iinfo['file']; $this->basename = (substr($this->rrd_file, -4) == '.rrd')?substr($this->rrd_file, 0, -4):$this->rrd_file; } + elseif (!is_null($conf_id) && file_exists($conf_id.'.rrd')) { + $this->rrd_file = $conf_id.'.rrd'; + $this->basename = $conf_id; + } else { $this->basename = !is_null($conf_id)?$conf_id:'xxx.unknown'; } - if (isset($iinfo['file'])) { + if (!is_null($this->rrd_file)) { // fields (data sources, DS) // name - DS name // type - one of COUNTER, GAUGE, DERIVE, ABSOLUTE @@ -312,7 +316,7 @@ class rrdstat { if (isset($gconf['path'])) { $fname = $gconf['path'].'/'.$fname; } $fname = str_replace('//', '/', $fname); - $graphrows = array(); $gC = 0; + $graphrows = array(); $specialrows = array(); $gC = 0; $gDefs = ''; $gGraphs = ''; $addSpecial = ''; if ($timeframe == 'day') { -- 2.43.0