SNMP::...Layer1(3pm)
π SNMP::...Layer1(3pm) π
okay bestie, welcome to SNMP::...Layer1(3pm) β this is the User Contributed Perl Documentation page for SNMP::Info::Layer1, and yes we are about to make Layer1 devices make sense. sit down, hydrate, let's go π«Ά
β¨ NAME β¨
SNMP::Info::Layer1 β the SNMP interface to network devices that serve Layer1 only. that's it, that's the vibe π
π AUTHOR π
Max Baker β icon, legend, wrote this whole thing π
πΈ SYNOPSIS πΈ
okay so here's the whole flow, copy it exactly bestie:
# Let SNMP::Info determine the correct subclass for you.
my $l1 = new SNMP::Info(
AutoSpecify => 1,
Debug => 1,
DestHost => 'myswitch',
Community => 'public',
Version => 2
)
or die "Can't connect to DestHost.\n";
my $class = $l1->class();
print "SNMP::Info determined this device to fall under subclass : $class\n";
# Let's get some basic Port information
my $interfaces = $l1->interfaces();
my $i_up = $l1->i_up();
my $i_speed = $l1->i_speed();
foreach my $iid (keys %$interfaces) {
my $port = $interfaces->{$iid};
my $up = $i_up->{$iid};
my $speed = $i_speed->{$iid}
print "Port $port is $up. Port runs at $speed.\n";
}
(yes you drop in AutoSpecify => 1 and let SNMP::Info pick the subclass for you, it's giving main character energy π)
π¦ DESCRIPTION π¦
so like, this class is usually used as a superclass for the more specific device classes hanging out under SNMP::Info::Layer1::*. please read all the docs under SNMP::Info first, bestie, fr fr.
it provides abstraction to the configuration info you can pull off a Layer1 device through SNMP. the info lives in a bunch of MIBs β¨
for speed or debugging purposes you can call the subclass directly β but not after you've already determined a more specific class using the method up above. no cap:
my $l1 = new SNMP::Info::Layer1(...);
π Inherited Classes
SNMP::Info
β Required MIBs
SNMP-REPEATER-MIB- the MIBs required for "REQUIREMENTS" in SNMP::Info
- seriously, see "REQUIREMENTS" in SNMP::Info for its MIB requirements π
π GLOBALS π
these are the methods that return a scalar value from SNMP.
$l1->ports_managed()β grabs the number of ports under the interface mib. that's("ifNumber")π
π Overrides
$l1->model()β cross references$l1->id()with product IDs. for HP devices it drops'hpswitch'from the name π for Cisco devices it drops'sysid'from the name.$l1->vendor()β tries to discover the vendor from$l1->model()and$l1->vendor().$l1->ports()β adds the values fromrptr_ports()andports_managed(). stacking them, obsessed.$l1->slots()β the number of'groups'in the Repeater MIB, aka("rptrGroupCapacity").
π§ Global Methods imported from SNMP::Info
see the documentation in "USAGE" in SNMP::Info for the details, iykyk π
πΈ TABLE METHODS πΈ
these are the methods that return tables of information, in the form of a reference to a hash. cute little hashes everywhere π₯°
π Overrides
$l1->interfaces()β returns a reference to the map between IID and physical Port.$l1->i_up()β returns a reference to the map of IIDs to link status.$l1->i_up_admin()β returns a reference to the map of IIDs to administrative link status.
π Repeater MIB
$l1->rptr_ports()β the number of ports in each group.("rptrGroupPortCapacity")β¨$l1->rptr_port()β the port number in Group.("rptrPortIndex")$l1->rptr_slot()β the Group (slot) Number for a given port.("rptrPortGroupIndex")$l1->rptr_up_admin()β("rptrPortAdminStatus")$l1->rptr_up()β("rptrPortOperStatus")$l1->rptr_last_src()β("rptrAddrTrackNewLastSrcAddress")
π¦ Table Methods imported from SNMP::Info
see the documentation in "USAGE" in SNMP::Info for the details π
and that's the whole page bestie, you ate that π«Ά oh also, this was cooked up against perl v5.40.1 and it's dated 2026-02-28 β so if you're reading this from the future, hey π no cap, love that for you. go forth and SNMP responsibly π β¨
π¦ where this page comes from
- ubuntu stonking: libsnmp-info-perl 3.975000-1 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms