The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

perfSONAR_PS::MA::SNMP - A module that provides methods for the SNMP MA.

DESCRIPTION

This module aims to offer simple methods for dealing with requests for information, and the related tasks of interacting with backend storage.

SYNOPSIS

use perfSONAR_PS::MA::SNMP;

my %conf = ();
$conf{"snmp"}->{"metadata_db_type"} = "xmldb";
$conf{"snmp"}->{"metadata_db_name"} = "/home/jason/perfSONAR-PS/MP/SNMP/xmldb";
$conf{"snmp"}->{"metadata_db_file"} = "snmpstore.dbxml";

my %ns = (
  nmwg => "http://ggf.org/ns/nmwg/base/2.0/",
  netutil => "http://ggf.org/ns/nmwg/characteristic/utilization/2.0/",
  nmwgt => "http://ggf.org/ns/nmwg/topology/2.0/",
  snmp => "http://ggf.org/ns/nmwg/tools/snmp/2.0/"
);

my $ma = perfSONAR_PS::MA::SNMP->new(\%conf, \%ns, $dirname);
if($ma->init != 0) {
  print "Couldn't initialize.\n";
  exit(-1);
}

# or
# $ma = perfSONAR_PS::MA::SNMP->new;
# $ma->setConf(\%conf);
# $ma->setNamespaces(\%ns);

$ma->init;
while(1) {
  $ma->receive;
}

DETAILS

This API is a work in progress, and still does not reflect the general access needed in an MA. Additional logic is needed to address issues such as different backend storage facilities.

API

The offered API is simple, but offers the key functions we need in a measurement archive.

init($self)

Calls the upper level init and verifys the config file.

receive($self)

Gets instructions from the perfSONAR_PS::Transport module, and handles the request.

handleRequest($self, $request, $output)

Functions as the 'gatekeeper' the the MA. Will either reject or accept requets. will also 'do nothing' in the event that a request has been acted on by the lower layer.

__handleRequest($self, $request, $output)

Processes the messages that this MA can handle.

handleMessageParameters($self, $msgParams)

Extracts and acts on special 'Message Level' parameters that may exist and change behavior or output. Not to be used externally.

maMetadataKeyRequest($self, $output, $request)

Handles the steps of a MetadataKeyRequest message. Not to be used externally.

metadataKeyRetrieveKey($self, $metadatadb, $key, $chain, $id, $request_namespaces, $output)

Helper function for 'maMetadataKeyRequest', handles the case where a 'key' is present in the request.

metadataKeyRetrieveMetadataData($self, $metadatadb, $metadata, $chain, $id, $output)

Helper function for 'maMetadataKeyRequest', handles the case where a 'key' is not present in the request.

maSetupDataRequest($self, $output, $request)

Handles the steps of a SetupDataRequest message. Not to be used externally.

setupDataRetrieveMetadataData($self, $metadatadb, $metadata, $id, $output)

Helper function for 'maSetupDataRequest', handles the case where a 'key' is not present in the request.

setupDataRetrieveKey($self, $metadatadb, $metadata, $chain, $id, $output)

Helper function for 'maSetupDataRequest', handles the case where a 'key' is present in the request.

handleData($self, $id, $data, $output, \%et)

Handles the data portion of a SetupDataRequest by contacting the supported databases.

retrieveSQL($self, $d, $mid, $output)

Gathers data from the SQL database and creates the necessary XML.

retrieveRRD($self, $d, $mid, $output)

Gathers data from the RR database and creates the necessary XML.

SEE ALSO

Log::Log4perl, File::Temp, Time::HiRes, perfSONAR_PS::MA::Base, perfSONAR_PS::MA::General, perfSONAR_PS::Common, perfSONAR_PS::Messages, perfSONAR_PS::DB::File, perfSONAR_PS::DB::XMLDB, perfSONAR_PS::DB::RRD, perfSONAR_PS::DB::SQL

To join the 'perfSONAR-PS' mailing list, please visit:

https://mail.internet2.edu/wws/info/i2-perfsonar

The perfSONAR-PS subversion repository is located at:

https://svn.internet2.edu/svn/perfSONAR-PS

Questions and comments can be directed to the author, or the mailing list. Bugs, feature requests, and improvements can be directed here:

https://bugs.internet2.edu/jira/browse/PSPS

VERSION

$Id: SNMP.pm 692 2007-11-02 12:36:04Z zurawski $

AUTHOR

Jason Zurawski, zurawski@internet2.edu

LICENSE

You should have received a copy of the Internet2 Intellectual Property Framework along with this software. If not, see <http://www.internet2.edu/membership/ip.html>

COPYRIGHT

Copyright (c) 2004-2007, Internet2 and the University of Delaware

All rights reserved.