YATG::Retrieve::Disk - Retrieve a set of data stored by YATG::Store::Disk
version 4.112532
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.
There is one subroutine, retrieve() which takes seven parameters:
retrieve()
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):
yatg_updater
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.
GigabitEthernet5/1
leaf
This should be the SNMP leaf name (and not the OID), for example ifHCInOctets.
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.
eval{};
Otherwise, the return value is an array reference of results corresponding to the data points you requested with start, end and step.
Oliver Gorwits <oliver@cpan.org>
This software is copyright (c) 2011 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.
To install YATG::Config, copy and paste the appropriate command in to your terminal.
cpanm
cpanm YATG::Config
CPAN shell
perl -MCPAN -e shell install YATG::Config
For more information on module installation, please visit the detailed CPAN module installation guide.