The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

RRD::Query - Perform queries on RRD file

DESCRIPTION

Simple wrapper around RRDs library to do some simple queries. It implemented more advanced error handling by using the Error module.

CONSTRUCTOR

    my $rq = new RRD::Query("/path/to/file.rrd");

METHODS

list

    @datasources = list();

Return the list of all datasource of the given file

Throws:

Error::RRDs - on RRDs library error

fetch

    ($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.

Options

ds

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: ifError, high_mem,low_mem,+.

cf

Consolidation function name you want to fetch. If omited, the AVERAGE consolidation function is used.

offset

Time offset to go back in the past from the last inserted value time.

Throws

Error::RRDs

on RRDs library error

Error::RRD::NoSuchDS

if datasource can't be found in RRD file

Error::RPN::Feature

if you try to use an RPN DS without Math::RPN installed

get_last

    $timestamp = get_last()

Returns the timestamp of the inserted value of the RRD file.

Throws

Error::RRDs

on RRDs library error

EXPORTS

isNaN

    $bool = isNaN($value);

Returns true if the value is Not a Number.

EXCEPTION CLASSES

Error::RRDs

Error::RRD::NoSuchDS

Error::RRD::isNaN

Error::RRD::Feature

AUTHOR

Olivier Poitrey <rs@rhapsodyk.net>

LICENCE

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

SEE ALSO

RRDs, Error

1 POD Error

The following errors were encountered while parsing the POD:

Around line 250:

You forgot a '=back' before '=head1'