mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-12 16:06:25 +02:00
Merge pull request #1748 from laf/rrdtool-1.5
Added support for rrdtool 1.5
This commit is contained in:
@@ -51,6 +51,7 @@ $config['own_hostname'] = 'localhost';
|
||||
|
||||
// Location of executables
|
||||
$config['rrdtool'] = '/usr/bin/rrdtool';
|
||||
$config['rrdtool_version'] = 1.4; // Doesn't need to contain minor numbers.
|
||||
$config['fping'] = '/usr/bin/fping';
|
||||
$config['fping6'] = 'fping6';
|
||||
$config['fping_options']['retries'] = 3;
|
||||
|
||||
@@ -166,7 +166,7 @@ function rrdtool_graph($graph_file, $options) {
|
||||
function rrdtool($command, $filename, $options) {
|
||||
global $config, $debug, $rrd_pipes, $console_color;
|
||||
|
||||
if ($command != 'create' && $config['rrdcached']) {
|
||||
if ($config['rrdtool_version'] >= 1.5 && $config['rrdcached']) {
|
||||
if (isset($config['rrdcached_dir']) && $config['rrdcached_dir'] !== false) {
|
||||
$filename = str_replace($config['rrd_dir'].'/', './'.$config['rrdcached_dir'].'/', $filename);
|
||||
$filename = str_replace($config['rrd_dir'], './'.$config['rrdcached_dir'].'/', $filename);
|
||||
@@ -206,19 +206,7 @@ function rrdtool($command, $filename, $options) {
|
||||
|
||||
|
||||
function rrdtool_create($filename, $options) {
|
||||
global $config, $console_color;
|
||||
|
||||
if ($config['norrd']) {
|
||||
print $console_color->convert('[%gRRD Disabled%n] ', false);
|
||||
}
|
||||
else {
|
||||
$command = $config['rrdtool']." create $filename $options";
|
||||
}
|
||||
|
||||
d_echo($console_color->convert('RRD[%g'.$command.'%n] '));
|
||||
|
||||
return shell_exec($command);
|
||||
|
||||
return rrdtool('create', $filename, $options);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user