Also fix the graph generating code for NfSen rrds (#6835)

* Also fix the graph generating code for NfSen rrds

* Updated NfSen document as well
This commit is contained in:
Aldemir Akpinar
2017-06-14 22:32:30 +03:00
committed by Neil Lathwood
parent af47676ce7
commit 572277bfaa
2 changed files with 12 additions and 3 deletions

View File

@@ -17,7 +17,11 @@ foreach ($config['nfsen_rrds'] as $nfsenrrds) {
$nfsensuffix = $config['nfsen_suffix'];
}
$basefilename_underscored = preg_replace('/\./', $config['nfsen_split_char'], $device['hostname']);
if (isset($config['nfsen_split_char']) && !empty($config['nfsen_split_char'])) {
$basefilename_underscored = preg_replace('/\./', $config['nfsen_split_char'], $device['hostname']);
} else {
$basefilename_underscored = $device['hostname'];
}
$nfsen_filename = preg_replace('/'.$nfsensuffix.'/', '', $basefilename_underscored);
if (is_file($nfsenrrds.$nfsen_filename.'.rrd')) {