RRD::Query - Perform queries on RRD file
Simple wrapper around RRDs library to do some simple queries. It implemented more advanced error handling by using the Error module.
my $rq = new RRD::Query("/path/to/file.rrd");
@datasources = list();
Return the list of all datasource of the given file
Error::RRDs - on RRDs library error
($value) = fetch($ds, cf => $cf, offset => $offset)
Fetch a single value from the datasource $ds of RRD file. If $offset is omitted, the last inserted value is returned, otherwise the last value - $offset is returned. If $cf (consolidation function) is omited, AVERAGE is used.
Datasource you want to fetch. If the datasource contains comat (,), your datasource will be interpreted as an RPN (Reverse Polish Notation) expression (see Math::RPN). If the
Math::RPN module isn't loadable, an
Error::RRD::Feature exception is thrown.
Some valide examples of datasource would be:
Consolidation function name you want to fetch. If omited, the AVERAGE consolidation function is used.
Time offset to go back in the past from the last inserted value time.
on RRDs library error
if datasource can't be found in RRD file
if you try to use an RPN DS without Math::RPN installed
$timestamp = get_last()
Returns the timestamp of the inserted value of the RRD file.
on RRDs library error
$bool = isNaN($value);
Returns true if the value is Not a Number.
Olivier Poitrey <email@example.com>
RRD::Query, performs queries on RRD files. Copyright (C) 2004 Olivier Poitrey
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
This library 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 Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA