SNMP::Info::MAU(3pm)
π NAME π
okay bestie, so this is SNMP::Info::MAU β your SNMP interface to the Medium Attachment Unit (MAU) MIB (that's RFC 2668, no cap) via SNMP. π¦
π AUTHOR π
Max Baker wrote this. iconic behavior fr fr. π
β¨ SYNOPSIS β¨
my $mau = new SNMP::Info (
AutoSpecify => 1,
Debug => 1,
DestHost => 'hpswitch',
Community => 'public',
Version => 2
);
my $class = $mau->class();
print " Using device sub class : $class\n";
πΈ DESCRIPTION πΈ
so like, SNMP::Info::MAU is a subclass of SNMP::Info that gives you access to the MAU-MIB (RFC 2668). This MIB is sometimes implemented on Layer 2 network devices. And MAU = Medium Attachment Unit, periodt. π
The MAU table is literally holding all the link and duplex info β for the port itself and for whatever device is plugged into that port. it's giving matchmaker energy honestly π«Ά
Normally you use or create a subclass of SNMP::Info that inherits this one. Do not use directly. like, that's not a suggestion bestie, that's a boundary π«β¨
For debugging purposes you can call the class directly, exactly like you would SNMP::Info:
my $mau = new SNMP::Info::MAU(...);
π§ Inherited Classes π§
None. it's an only child, main character energy, no family tree π
π Required MIBs π
MAU-MIBIANA-MAU-MIB
π GLOBALS π
These are methods that return scalar value from SNMP.
None β empty. truly giving nothing and that's fine π
π₯ TABLE METHODS π₯
These are methods that return tables of information in the form of a reference to a hash.
$mau->mau_i_duplex()β parsesmau_indexandmau_linkto return the duplex information for interfaces.$mau->mau_i_duplex_admin()β parses"mac_index","mau_autostat","mau_type_admin"in order to find the admin duplex setting for all the interfaces.
Returns either (auto,full,half).
$mau->mau_i_duplex_admin_old()β called bymau_i_duplex_admin()if"mau_type_admin"is empty. Parses"mau_index","mau_autostat","mau_autosent"in order to find the admin duplex setting for all the interfaces.
Returns either (auto,none,full,half).
$mau->mau_i_speed_admin()β returns admin speed setting for all the interfaces. slay π«
π MAU Interface Table Methods π
$mau->mau_index()β Returns a list of interfaces and their index in the MAU IF Table. ("ifMauIfIndex")$mau->mau_link()β Returns the type of Media Access used. This is essentially the type of link in use. eg.dot3MauType100BaseTXFD- 100BaseT at Full Duplex ("ifMauType")$mau->mau_status()β Returns the admin link condition as1- other2- unknown3- operational4- standby5- shutdown6- reset
Use 5 and !5 to see if the link is up or down on the admin side.
("ifMauStatus")
$mau->mau_up()β Returns the current link condition (C<ifMauMediaAvailable>)$mau->mau_type()β Returns a 32bit string reporting the capabilities of the port from a MAU POV. Directly fromMAU-MIB:
Bit Capability
0 other or unknown
1 AUI
2 10BASE-5
3 FOIRL
4 10BASE-2
5 10BASE-T duplex mode unknown
6 10BASE-FP
7 10BASE-FB
8 10BASE-FL duplex mode unknown
9 10BROAD36
10 10BASE-T half duplex mode
11 10BASE-T full duplex mode
12 10BASE-FL half duplex mode
13 10BASE-FL full duplex mode
14 100BASE-T4
15 100BASE-TX half duplex mode
16 100BASE-TX full duplex mode
17 100BASE-FX half duplex mode
18 100BASE-FX full duplex mode
19 100BASE-T2 half duplex mode
20 100BASE-T2 full duplex mode
("ifMauTypeList")
$mau->mau_type_admin()("ifMauDefaultType")$mau->mau_auto()β Indicates whether or not auto-negotiation is supported. ("ifMauAutoNegSupported")$mau->mau_autostat()β Returns status of auto-negotiation mode for ports. ("ifMauAutoNegAdminStatus")$mau->mau_autosent()β Returns a 32 bit bit-string representing the capabilities we are broadcasting on that port. Uses the same decoder as$mau->mau_type(). ("ifMauAutoNegCapAdvertised")$mau->mau_autorec()β Returns a 32 bit bit-string representing the capabilities of the device on the other end. Uses the same decoder as$mau->mau_type(). ("ifMauAutoNegCapReceived")
β SET METHODS β
These are methods that provide SNMP set functionality for overridden methods or provide a simpler interface to complex set operations. See "SETTING DATA VIA SNMP" in SNMP::Info for general information on set operations.
$mau->mau_set_i_speed_admin(speed, ifIndex)β Sets port speed, must be supplied with speed and port"ifIndex".
heads up bestie π¨ note that this method has some limitations since there is no way to reliably set the port speed independently of the port duplex setting on certain devices, notably the Cisco Cat4k series. π
Speed choices are '10', '100', '1000', 'auto'. π
$mau->mau_set_i_duplex_admin(duplex, ifIndex)β Sets port duplex, must be supplied with duplex and port"ifIndex".
same tea, different cup π΅ note that this method has some limitations since there is no way to reliably set the port duplex independently of the port speed setting on certain devices, notably the Cisco Cat4k series. π
Duplex choices are 'auto', 'half', 'full'.
$mau->mau_set_i_speed_duplex_admin(speed, duplex, ifIndex)β Sets port speed and duplex settings, must be supplied with speed, duplex and port"ifIndex".
Accepts the following values for speed and duplex:
Speed/Duplex
------------
auto/auto (this is a special case)
10/half
10/full
100/half
100/full
1000/half
1000/full
π¦ Utility Functions π¦
munge_int2bin()β Unpacks an integer into a 32bit bit string.$mau->_isfullduplex(bitstring)β Boolean. Checks to see if any of the full_duplex types frommau_type()are high. Currently bits 11,13,16,18,20.$mau->_ishalfduplex(bitstring)β Boolean. Checks to see if any of the half_duplex types frommau_type()are high. Currently bits 10,12,15,17,19.
and that's the whole page bestie π this beauty shipped as perl v5.40.1, dated 2026-02-28, straight out of the User Contributed Perl Documentation collection, and it lives in section 3pm where all the perl module girlies hang out πβ¨ mwah, go read your MIBs, ily π«Άπ
π¦ 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