SysAdmin::SNMP - Perl SNMP class wrapper module
use SysAdmin::SNMP; my $ip_address = "192.168.1.1"; my $community = "public"; my $snmp_object = new SysAdmin::SNMP(IP => "$ip_address", COMMUNITY => "$community"); my $sysName = '.1.3.6.1.2.1.1.5.0'; my $query_result = $snmp_object->snmpget("$sysName"); print "$ip_address\'s System Name is $query_result
This is a sub class of SysAdmin. It was created to harness Perl Objects and keep code abstraction to a minimum. This class acts as a master class for SNMP objects.
SysAdmin::SNMP uses Net::SNMP to interact with SNMP enabled equipment.
new()
my $snmp_object = new SysAdmin::SNMP(IP => "$ip_address", COMMUNITY => "$community");
Declare the SysAdmin::SNMP object instance. Takes the network element ip address and its SNMP community string as the only variables to use.
IP => "$ip_address"
Declare the IP address of the network element.
COMMUNITY => "$community"
Declares the SNMP community string.
snmpwalk()
snmpget()
fetchInterfaces()
fetchActiveInterfaces()
head3 checkValidOID()
checkValidOID()
Net::SNMP - Object oriented interface to SNMP
Miguel A. Rivera
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.
To install SysAdmin, copy and paste the appropriate command in to your terminal.
cpanm
cpanm SysAdmin
CPAN shell
perl -MCPAN -e shell install SysAdmin
For more information on module installation, please visit the detailed CPAN module installation guide.