Added support for rrdtool 1.5

This commit is contained in:
laf
2015-08-23 19:36:22 +00:00
parent a9b08fbaa0
commit c0125f28e4
4 changed files with 33 additions and 20 deletions

View File

@@ -5,7 +5,11 @@ These machines can be in a different physical location and therefore minimize ne
Devices can also be groupped together into a `poller_group` to pin these devices to a single or a group of designated pollers.
All pollers need to share their RRD-folder, for example via NFS or a combination of NFS and rrdcached.
~~All pollers need to share their RRD-folder, for example via NFS or a combination of NFS and rrdcached.~~
> This is no longer a strict requirement with the use of rrdtool 1.5 and above. If you are NOT running 1.5 then you will still
need to share the RRD-folder.
It is also required that all pollers can access the central memcached to communicate with eachother.
In order to enable distributed polling, set `$config['distributed_poller'] = true` and your memcached details into `$config['distributed_poller_memcached_host']` and `$config['distributed_poller_memcached_port']`.
@@ -49,7 +53,14 @@ The pollers, web and API layers should all be able to access the database server
####RRD Storage
Central storage should be provided so all RRD files can be read from and written to in one location. As suggested above, it's recommended that RRD Cached is configured and used.
For this example, we are running RRDCached to allow all pollers and web/api servers to read/write to the rrd iles with the rrd directory also exported by NFS for simple access and maintenance.
For this example, we are running RRDCached to allow all pollers and web/api servers to read/write to the rrd iles ~~with the rrd directory also exported by NFS for simple access and maintenance.~~
Sharing rrd files via something like NFS is no longer required if you run rrdtool 1.5 or greater. If you don't - please share your rrd folder as before. If you run rrdtool
1.5 or greater then add this config to your pollers:
```php
$config['rrdtool_version'] = 1.5;
```
####Memcache
Memcache is required for the distributed pollers to be able to register to a central location and record what devices are polled. Memcache can run from any of the kit so long as it is accessable by all pollers.
@@ -88,4 +99,10 @@ $config['rrd_dir'] = "/opt/librenms/rrd";
$config['rrdcached_dir'] = "";
```
For rrdtool 1.5 or greater then you can enable support for rrdcached to create the rrd files:
```php
$config['rrdtool_version'] = 1.5;
```
$config['rrdcached_dir'] Is only needed if you are using tcp connections for rrd cached and needs only to be set if you want to store rrd files within a sub directory of your rrdcached base directory.

View File

@@ -6,19 +6,19 @@ This document will explain how to setup RRDCached for LibreNMS.
This example is based on a fresh LibreNMS install, on a minimimal CentOS installation.
In this example, we'll use the Repoforge repository.
```ssh
```php
rpm -ivh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
vi /etc/yum.repos.d/rpmforge.repo
```
- Enable the Extra repo
```ssh
```php
yum update rrdtool
vi /etc/yum.repos.d/rpmforge.repo
```
- Disable the [rpmforge] and [rpmforge-extras] repos again
```ssh
```php
vi /etc/sysconfig/rrdcached
# Settings for rrdcached
@@ -34,6 +34,13 @@ service rrdcached start
```
Edit config.php to include:
```ssh
```php
$config['rrdcached'] = "unix:/var/run/rrdcached/rrdcached.sock";
```
> If you are using rrdtool / rrdcached version 1.5 or above then this now supports creating rrd files over rrdcached. To
enable this set the following config:
```php
$config['rrdtool_version'] = 1.5;
```

View File

@@ -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['fping_options']['retries'] = 3;
$config['fping_options']['timeout'] = 500;

View File

@@ -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);
}