I have few 100s of rrds and i want to add 5 extra datasource to all of those rrds.
- Is it advisable to do so
- Whats the best way and the fastest way to do it
-- Soln --
David OBrien replied in the mailing list
after searching the archives ( which you should have done first ) and googling I found several people using this...
with perl. Install RRD:Simple
#!/usr/local/bin/perl
use strict;
use RRD::Simple ();
my $rrd = RRD::Simple->new();
my $rrdfile=$ARGV[0];
my $source=$ARGV[1];
my $type=$ARGV[2];
chomp($type);
$rrd->add_source($rrdfile, $source => $type);
usage:
./addSource.pl file.rrd ds GAUGE
or whatever the type is..
Enjoy.
If you're using PNP4Nagios (https://docs.pnp4nagios.org/pnp-0.6/start), they provide a utility script rrd_modify.pl for modifying existing RRD data files.
use rrddump and rrdrestore.
just so:
you can refer from here: http://osdir.com/ml/db.rrdtool.user/2003-08/msg00115.html
and here: http://www.docum.org/drupal/sites/default/files/add_ds_to_rrd.pl_.txt
Since version 1.5
rrdtool create
can "pre-fill" the data from existing file(s) with the--source
option. This feature solves the problem without the need of additional scripts.