mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Merge pull request #1748 from laf/rrdtool-1.5
Added support for rrdtool 1.5
This commit is contained in:
@@ -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.
|
||||
|
@@ -2,6 +2,13 @@
|
||||
|
||||
This document will explain how to setup RRDCached for LibreNMS.
|
||||
|
||||
> 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;
|
||||
```
|
||||
|
||||
### RRDCached installation CentOS 6
|
||||
This example is based on a fresh LibreNMS install, on a minimimal CentOS 6 installation.
|
||||
In this example, we'll use the Repoforge repository.
|
||||
@@ -34,7 +41,7 @@ service rrdcached start
|
||||
```
|
||||
|
||||
- Edit /opt/librenms/config.php to include:
|
||||
```ssh
|
||||
```php
|
||||
$config['rrdcached'] = "unix:/var/run/rrdcached/rrdcached.sock";
|
||||
```
|
||||
### RRDCached installation CentOS 7
|
||||
|
@@ -74,7 +74,7 @@ foreach ($rrd_list as $rrd) {
|
||||
$stack = 'STACK';
|
||||
}
|
||||
|
||||
$rrd_options .= ' AREA:inbits'.$i.'#'.$colour_in.":'".rrdtool_escape($rrd['descr'], 9)."In ':$stack";
|
||||
$rrd_options .= ' AREA:inbits'.$i.'#'.$colour_in.":'".rrdtool_escape($rrd['descr'], 9)."In '$stack";
|
||||
$rrd_options .= ' GPRINT:inbits'.$i.':LAST:%6.2lf%s';
|
||||
$rrd_options .= ' GPRINT:inbits'.$i.':AVERAGE:%6.2lf%s';
|
||||
$rrd_options .= ' GPRINT:inbits'.$i.':MAX:%6.2lf%s';
|
||||
@@ -84,8 +84,8 @@ foreach ($rrd_list as $rrd) {
|
||||
}
|
||||
|
||||
$rrd_options .= " COMMENT:'\\n'";
|
||||
$rrd_optionsb .= ' AREA:outbits'.$i.'_neg#'.$colour_out."::$stack";
|
||||
$rrd_options .= ' HRULE:999999999999999#'.$colour_out.":'".str_pad('', 10)."Out':";
|
||||
$rrd_optionsb .= ' AREA:outbits'.$i.'_neg#'.$colour_out.":$stack";
|
||||
$rrd_options .= ' HRULE:999999999999999#'.$colour_out.":'".str_pad('', 10)."Out'";
|
||||
$rrd_options .= ' GPRINT:outbits'.$i.':LAST:%6.2lf%s';
|
||||
$rrd_options .= ' GPRINT:outbits'.$i.':AVERAGE:%6.2lf%s';
|
||||
$rrd_options .= ' GPRINT:outbits'.$i.':MAX:%6.2lf%s';
|
||||
@@ -141,21 +141,21 @@ if (!$args['nototal']) {
|
||||
|
||||
$rrd_options .= " COMMENT:' \\n'";
|
||||
|
||||
$rrd_options .= " HRULE:999999999999999#FFFFFF:'".str_pad('Total', 10)."In ':";
|
||||
$rrd_options .= " HRULE:999999999999999#FFFFFF:'".str_pad('Total', 10)."In '";
|
||||
$rrd_options .= ' GPRINT:inbits:LAST:%6.2lf%s';
|
||||
$rrd_options .= ' GPRINT:inbits:AVERAGE:%6.2lf%s';
|
||||
$rrd_options .= ' GPRINT:inbits:MAX:%6.2lf%s';
|
||||
$rrd_options .= " GPRINT:totin:%6.2lf%s$total_units";
|
||||
$rrd_options .= " COMMENT:'\\n'";
|
||||
|
||||
$rrd_options .= " HRULE:999999999999990#FFFFFF:'".str_pad('', 10)."Out':";
|
||||
$rrd_options .= " HRULE:999999999999990#FFFFFF:'".str_pad('', 10)."Out'";
|
||||
$rrd_options .= ' GPRINT:outbits:LAST:%6.2lf%s';
|
||||
$rrd_options .= ' GPRINT:outbits:AVERAGE:%6.2lf%s';
|
||||
$rrd_options .= ' GPRINT:outbits:MAX:%6.2lf%s';
|
||||
$rrd_options .= " GPRINT:totout:%6.2lf%s$total_units";
|
||||
$rrd_options .= " COMMENT:'\\n'";
|
||||
|
||||
$rrd_options .= " HRULE:999999999999990#FFFFFF:'".str_pad('', 10)."Agg':";
|
||||
$rrd_options .= " HRULE:999999999999990#FFFFFF:'".str_pad('', 10)."Agg'";
|
||||
$rrd_options .= ' GPRINT:bits:LAST:%6.2lf%s';
|
||||
$rrd_options .= ' GPRINT:bits:AVERAGE:%6.2lf%s';
|
||||
$rrd_options .= ' GPRINT:bits:MAX:%6.2lf%s';
|
||||
|
@@ -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