NAME

YATG::Retrieve::Disk - Retrieve a set of data stored by YATG::Store::Disk

VERSION

version 5.140510

DESCRIPTION

You can load this module to retrieve a set of data which has previously been stored by YATG::Store::Disk. An implementation of this process is given in the CGI bundled with this distribution, which displays results of SNMP polls.

For more information on the data storage format, see YATG::Store::Disk.

REQUIREMENTS

Install the following additional modules to use this plugin:

USAGE

There is one subroutine, retrieve() which takes seven parameters:

config

Load up your yatg_updater config using the following idiom, and pass the result in this parameter (assuming the file is named yatg.yml):

use YATG::Config;
YATG::Config->Defaults->{'no_validation'} = 1;

my $yatg_conf = YATG::Config->parse('yatg.yml')
    || die 'failed to load yatg config';

# now pass in $yatg_conf
device

This should be the IP address of a device.

port

This should be the port name, for example GigabitEthernet5/1.

leaf

This should be the SNMP leaf name (and not the OID), for example ifHCInOctets.

start

This should be a UNIX timestamp (i.e. seconds since the epoch) representing the start point for retrieved results.

end

This should be a UNIX timestamp (i.e. seconds since the epoch) representing the end point for retrieved results.

step

This parameter is optional. If not specified, the filename of the result set encodes the polling interval which will then be used for the returned results interval (i.e. one data point per step seconds returned).

Alternatively you can pass a number of seconds in this parameter and the module will do its best to provide one data point per step seconds in the returned results.

The subroutine will die if it encounters difficulty opening the data file or extracting results from it, so use an eval{}; construct or similar.

Otherwise, the return value is an array reference of results corresponding to the data points you requested with start, end and step.

SEE ALSO

Tie::File::FixedRecLen

AUTHOR

Oliver Gorwits <oliver@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2014 by University of Oxford.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.