man Smokeping::RRDtools (Fonctions bibliothèques) - Tools for RRD file handling
NAME
Smokeping::RRDtools - Tools for RRD file handling
SYNOPSIS
use Smokeping::RRDtools; use RRDs;
my $file = '/path/to/file.rrd';
# get the create arguments that $file was created with my $create = Smokeping::RRDtools::info2create($file);
# use them to create a new file RRDs::create('/path/to/file2.rrd', @$create);
# or compare them against another create list my @create = ('--step', 60, 'DS:ds0:GAUGE:120:0:U', 'RRA:AVERAGE:0.5:1:1008'); my ($fatal, $comparison) = Smokeping::RRDtools::compare($file, \@create); print "Fatal: " if $fatal; print "Create arguments didn't match: $comparison\n" if $comparison;
Smokeping::RRDtools::tuneds($file, \@create);
DESCRIPTION
This module offers three functions, CWinfo2create, CWcompare and CWtuneds. The first can be used to recreate the arguments that an RRD file was created with. The second checks if an RRD file was created with the given arguments. The thirds tunes the DS parameters according to the supplied create string.
The function CWinfo2create must be called with one argument: the path to the interesting RRD file. It will return an array reference of the argument list that can be fed to CWRRDs::create. Note that this list will never contain the CWstart parameter, but it will contain the CWstep parameter.
The function CWcompare must be called with two arguments: the path to the interesting RRD file, and a reference to an argument list that could be fed to CWRRDs::create. The function will then simply compare the result of CWinfo2create with this argument list. It will return an array of two values: CW(fatal, text) where CWfatal is 1 if it found a fatal difference, and 0 if not. The CWtext will contain an error message if CWfatal == 1 and a possible warning message if CWfatal == 0. If CWfatal == 0 and CWtext is CWundef, all the arguments matched.
Note that if there is a CWstart parameter in the argument list, CWcompare disregards it. If CWstep isn't specified, CWcompare will use the CWrrdtool default of 300 seconds. CWcompare ignores non-matching DS parameters since CWtuneds will fix them.
CWtuneds talks on stderr about the parameters it fixes.
NOTES
This module is not particularly specific to Smokeping, it is just distributed with it.
BUGS
Probably.
COPYRIGHT
Copyright (c) 2005 by Niko Tyni.
AUTHOR
Niko Tyni <ntyni@iki.fi>
LICENSE
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., 675 Mass Ave, Cambridge, MA 02139, USA.