Collect rrdcollect output from several hosts to update local RRD files
Perl
Switch branches/tags
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
debian
examples
MANIFEST
Makefile.PL
README
README.pod
rrdcollect-remote

README.pod

NAME

rrdcollect-remote - Collect rrdcollect output from several hosts to update local RRD files.

SYNOPSIS

rrdcollect-remote [-MFh] [-c config] [-l logconfig]

DESCRIPTION

rrdcollect-remote is a daemon that uses the rrdcollect ability to print RRD updates commands to its standard output to do updates from a remote machine using a persistent connection. Thus you can centralize rrdcollect outputs of several hosts on a single repository with no need for complex and intrusive file-sharing protocols like NFS or CPU-intensive and inefficiant periodic polling like SNMP and so on.

OPTIONS

-c, --conf file

Path to the configuration file. By default, rrdcollect-remote looks into /etc/rrdcollect-remote/rrdcollect-remote.conf file.

-l, --logconf file

Path to the log configuration file. By default, rrdcollect-remote looks into /etc/rrdcollect-remote/log.conf file.

-p, pid-file file

Path to the PID file. By default, rrdcollect-remote uses the /var/run/rrdcollect-remote.pid file

-v, --version

Print the version number

-M, --m4

Pre-process the configuration file with the macro expansion package m4.

-F, --forground

Don't put rrdcollect-remote process into background.

-h, --help

Print the help message.

CONFIGURATION

If the configuration end with .m4 it will be pre-processed with GNU m4.

host

Address of the host on which you want grabbe rrdcollect output.

You can add a group information to you host. This information can be usefull for target RRD path generation. You add group info, prepend your host with the group name between brackets (eg: [mygroup]example.com).

retry-interval

Number of seconds to wait before retry a connection to the remote host on failure. Default value is 5 seconds.

rrdfiles-path

Path to the base directory for RRD files. You can use some tags that will be changed at runtime like:

%h

short hostname (minus the domain part)

%d

domainname (can be empty)

%H

full hostname

%g

host group (can be empty)

%n

name (RRD filename without the directory part nor the .rrd extension)

%f

RRD filename

%F

RRD full file path (often same as %f)

Default value is /var/lib/rrdcollect-remote/%h/%f.

logconf

Path to the log configuration file. Default value is /etc/rrdcollect-remote/rrdcollect-remote.conf.

pid-file

Path to the PID file. Default value is /var/run/rrdcollect-remote.pid.

auto-rrd-create

Enable/disable creation of RRD files when needed. If this option is on, rrdcollect-remote will try to find RRD create information for the missing file in comments of the remote rrdcollect configuration file.

Can be on or off. Default value is On.

timeout

How many second to wait for connection timeout.

CLIENT INSTALLATION

In order to allow rrdcollect-remote to gather rrdcollect output, you have to setup each machine you want to monitor to output rrdcollect data on a specific port. Default port is 9042 if not specified in the rrdcollect-remote configuration.

The easier want to proceed is to use the super daemon inetd. The inetd line would do the trick:

9042 stream tcp nowait root /usr/sbin/rrdcollect /usr/sbin/rrdcollect -o-

If you need some more security, you can use the tcp wrapper to restrict access to certain IPs (see tcpd man page for more info):

9042 stream tcp nowait root /usr/sbin/tcpd /usr/sbin/rrdcollect -o-

AUTOMATIC RRD CREATION

The rrdcollect tool doesn't implement a way to create RRD files. It only update DS of existing RRD files, letting you do the RRD creation work. So rrdcollect-remote use a trick to let you inform it how to create RRD files. It's pretty simple, you just have to put a comment starting with "rrdtool create <file.rrd>" words followed by valid RRD creation arguments. You can break the command if you end the line by a backslash and if the next line (containing the rest of the command) start with a comment character (sharp). Then you can cat the configuration file into the socket just before to start rrdcollect. Thus rrdcollect-remote will keep all lines starting with a sharp (#) and extract rrdcreate <file.rrd> args... commands from them if needed.

You can use the special character "#" in the filename to match one or more numbers in the file (see example).

Exemple of valid RRD create info:

# Auto-RRD-Create Example
#
# rrdtool create test.rrd --step 5 \
#     DS:foobar:GAUGE:2:0:U \
#     RRA:AVERAGE:0.5:1:18000

file:///proc/test
"foobar: %d"            test.rrd:foobar

# Pattern example
#
# rrdtool create cpu#-stat.rrd --step 5 \
#     DS:user:COUNTER:60:0:U \
#     DS:nice:COUNTER:60:0:U \
#     DS:system:COUNTER:60:0:U \
#     DS:idle:COUNTER:60:0:U \
#     RRA:AVERAGE:0.5:1:18000

file:///proc/stat
"cpu0 %d %d %d %d" cpu0-stat.rrd:user,nice,system,idle
"cpu1 %d %d %d %d" cpu1-stat.rrd:user,nice,system,idle
"cpu2 %d %d %d %d" cpu2-stat.rrd:user,nice,system,idle
"cpu3 %d %d %d %d" cpu3-stat.rrd:user,nice,system,idle

Example of script you can launch from inetd to allow auto-creation:

#!/bin/sh
grep '^#' /etc/rrdcollect.conf
exec /usr/sbin/rrdcollect -o- -c /etc/rrdcollect.conf

LOGGER CONFIGURATION

See Log::Log4perl

EXAMPLES

See example directory from the source tree.

SEE ALSO

rrdcollect, rrdtool, Log::Log4perl, perl

AUTHOR

Olivier Poitrey <rs@mmania.com>

LICENCE

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

COPYRIGHT

Copyright (C) 2004 - Olivier Poitrey