mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Fix remote rrdtool_check_rrd_exists() calls (#4196)
It was comparing with the full name when rrdcached only printed out the relative name. Thanks mikmak on irc for lots of troubleshooting.
This commit is contained in:
committed by
Neil Lathwood
parent
1055003d3f
commit
111d967e7d
@@ -260,7 +260,8 @@ function rrdtool_check_rrd_exists($filename)
|
|||||||
global $config;
|
global $config;
|
||||||
if ($config['rrdcached'] && version_compare($config['rrdtool_version'], '1.5', '>=')) {
|
if ($config['rrdcached'] && version_compare($config['rrdtool_version'], '1.5', '>=')) {
|
||||||
$chk = rrdtool('last', $filename, '');
|
$chk = rrdtool('last', $filename, '');
|
||||||
return strpos(implode($chk), "$filename': No such file or directory") === false;
|
$filename = str_replace(array($config['rrd_dir'].'/', $config['rrd_dir']), '', $filename);
|
||||||
|
return !str_contains(implode($chk), "$filename': No such file or directory");
|
||||||
} else {
|
} else {
|
||||||
return is_file($filename);
|
return is_file($filename);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user