SNMP::Info::Layer3::NetSNMP - SNMP Interface to L3 Net-SNMP Devices
Bradley Baetz and Bill Fenner
# Let SNMP::Info determine the correct subclass for you. my $netsnmp = new SNMP::Info( AutoSpecify => 1, Debug => 1, DestHost => 'myrouter', Community => 'public', Version => 2 ) or die "Can't connect to DestHost.\n"; my $class = $netsnmp->class(); print "SNMP::Info determined this device to fall under subclass : $class\n";
Subclass for Generic Net-SNMP devices
See SNMP::Info::Layer3 for its own MIB requirements.
See SNMP::Info::LLDP for its own MIB requirements.
These are methods that return scalar value from SNMP
Returns 'Net-SNMP'.
Returns the OS extracted from sysDescr.
sysDescr
Returns the software version extracted from sysDescr, along with the Net-SNMP version.
Returns the system uptime instead of the agent uptime. NOTE: discontinuity timers and other Time Stamp based objects are based on agent uptime, so use orig_uptime().
Returns ''.
See documentation in SNMP::Info::Layer3 for details.
See documentation in SNMP::Info::LLDP for details.
These are methods that return tables of information in the form of a reference to a hash.
Returns reference to hash. Increments value of IID if port is to be ignored.
Ignores loopback
Link Layer Discovery Protocol (LLDP) support. The device must be running an optional LLDP agent, such as lldpd, which can integrate with the SNMP agent.
Returns true if the device is running LLDP.
Returns reference to hash. Key: iid Value: local device port (interfaces)
Returns reference to hash. Key: iid Value: remote IPv4 address
If multiple entries exist with the same local port, c_if(), with different IPv4 addresses, c_ip(), there is either a non-LLDP device in between two or more devices or multiple devices which are not directly connected.
Use the data from the Layer2 Topology Table below to dig deeper.
Returns reference to hash. Key: iid Value: remote port (interfaces)
Returns reference to hash. Key: iid Value: string value used to identify the chassis component associated with the remote system.
Returns reference to hash. Key: iid Value: Remote Device Type
In order to cause SNMP::Info to classify your device into this class, it may be necessary to put a configuration line into your snmpd.conf similar to
sysobjectid .1.3.6.1.4.1.8072.3.2.N
where N is the object ID for your OS from the NET-SNMP-TC MIB (or 255 if not listed). Some Net-SNMP installations default to an incorrect return value for system.sysObjectId.
NET-SNMP-TC
system.sysObjectId
In order to recognize a Net-SNMP device as Layer3, it may be necessary to put a configuration line similar to
sysservices 76
in your snmpd.conf.
To install SNMP::Info, copy and paste the appropriate command in to your terminal.
cpanm
cpanm SNMP::Info
CPAN shell
perl -MCPAN -e shell install SNMP::Info
For more information on module installation, please visit the detailed CPAN module installation guide.