mirror of
https://github.com/librenms/librenms.git
synced 2024-09-21 18:38:25 +00:00
Updated function and use - generate_smokeping_file
This commit is contained in:
parent
0e45bad173
commit
e356d80141
@ -31,7 +31,7 @@ if($width > "500")
|
||||
$rrd_options .= " COMMENT:'".substr(str_pad($unit_text, $descr_len+5),0,$descr_len+5)." RTT Loss SDev RTT\:SDev \l'";
|
||||
}
|
||||
|
||||
$filename_dir = generate_smokeping_dir($device);
|
||||
$filename_dir = generate_smokeping_file($device);
|
||||
if($src['hostname'] == $config['own_hostname'])
|
||||
{
|
||||
$filename = $filename_dir . $device['hostname'].'.rrd';
|
||||
|
@ -751,7 +751,7 @@ function get_smokeping_files($device) {
|
||||
global $config;
|
||||
if (isset($config['smokeping']['dir'])) {
|
||||
$smokeping_files = array();
|
||||
$smokeping_dir = generate_smokeping_dir($device);
|
||||
$smokeping_dir = generate_smokeping_file($device);
|
||||
if ($handle = opendir($smokeping_dir)) {
|
||||
while (false !== ($file = readdir($handle))) {
|
||||
if ($file != "." && $file != "..") {
|
||||
@ -778,18 +778,13 @@ function get_smokeping_files($device) {
|
||||
function generate_smokeping_file($device,$file) {
|
||||
global $config;
|
||||
if ($config['smokeping']['integration'] === true) {
|
||||
return $config['smokeping']['dir'] .'/'. $device['type'] .'/'. $file;
|
||||
$response = $config['smokeping']['dir'] .'/'. $device['type'] .'/';
|
||||
} else {
|
||||
return $config['smokeping']['dir'] . $file;
|
||||
}
|
||||
}
|
||||
|
||||
function generate_smokeping_dir($device) {
|
||||
global $config;
|
||||
if ($config['smokeping']['integration'] === true) {
|
||||
return $config['smokeping']['dir'] .'/'. $device['type'] .'/';
|
||||
} else {
|
||||
return $config['smokeping']['dir'];
|
||||
$response = $config['smokeping']['dir'] . '/';
|
||||
}
|
||||
if (!empty($file)) {
|
||||
$response = $response . $file;
|
||||
}
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user