App::Netsync::SNMP - SNMP framework
This package contains functions for handling SNMP communications.
use App::Netsync::SNMP; App::Netsync::SNMP::configure({ 'SecName' => 'your username here', 'SecLevel' => 'AuthPriv', 'AuthProto' => 'SHA', 'AuthPass' => 'your password here', 'PrivProto' => 'AES', 'PrivPass' => 'your key here', },[ 'IF-MIB','ENTITY-MIB', # standard 'CISCO-STACK-MIB', # Cisco 'FOUNDRY-SN-AGENT-MIB', # Brocade 'SEMI-MIB', # HP ]); my $ip = '93.184.216.119'; my $session = App::Netsync::SNMP::Session $ip; my $info1 = App::Netsync::SNMP::Info $ip; my $info2 = App::Netsync::SNMP::Info $session; my ($ifNames,$ifIIDs) = App::Netsync::SNMP::get1 ([ ['.1.3.6.1.2.1.31.1.1.1.1' => 'ifName'], ['.1.3.6.1.2.1.2.2.1.2' => 'ifDescr'], ],$session); App::Netsync::SNMP::set ('ifAlias',$_,'Vote for Pedro',$session) foreach @$ifIIDs;
configure the operating environment
Arguments
( \%environment , \@MIBs )
key-value pairs of environment configurations
Available Environment Settings
the location of necessary MIBs
default: /usr/share/<script name>/mib
See SNMP::Session documentation for more acceptable settings.
a list of MIBs to load
returns an SNMP::Session object.
Note: configure needs to be run first!
( $ip )
an IP address to connect to
returns an SNMP::Info object
an IP address to connect to OR an SNMP::Session
Note: The following snippets are equivalent:
App::Netsync::SNMP::Info $ip;
App::Netsync::SNMP::Info App::Netsync::SNMP::Session $ip;
attempt to retrieve an OID from a provided list, stopping on success
( \@OIDs , $ip )
a prioritized list of OIDs to try and retreive
an IP address to connect to or an SNMP::Session
attempt to set a new value on a device using SNMP
( $OID , $IID , $value , $ip )
the OID to write the value argument to
the IID to write the value argument to
the value to write to OID.IID
David Tucker, <dmtucker at ucsc.edu>
<dmtucker at ucsc.edu>
Please report any bugs or feature requests to bug-netsync at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=App-Netsync. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-netsync at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc App::Netsync
You can also look for information at:
RT: CPAN's request tracker (report bugs here)
http://rt.cpan.org/NoAuth/Bugs.html?Dist=App-Netsync
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/App-Netsync
CPAN Ratings
http://cpanratings.perl.org/d/App-Netsync
Search CPAN
http://search.cpan.org/dist/App-Netsync/
Copyright 2013 David Tucker.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
To install App::Netsync, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::Netsync
CPAN shell
perl -MCPAN -e shell install App::Netsync
For more information on module installation, please visit the detailed CPAN module installation guide.