SNMP::...Juniper(3pm)
π SNMP::Info::Layer3::Juniper π
okay so bestie, this is a page from the User Contributed Perl Documentation (the SNMP::...Juniper(3pm) manual, which is the short name for SNMP::Info::Layer3::Juniper) and it's literally the whole guide to talking SNMP to Juniper routers. no cap. let's get into it π¦
β¨ NAME β¨
SNMP::Info::Layer3::Juniper β the SNMP Interface to L3 Juniper Devices. it's giving layer three, but make it Juniper. π
π AUTHOR π
Bill Fenner β the icon who wrote this. π
β¨ SYNOPSIS β¨
so here's how you use it, fr fr:
# Let SNMP::Info determine the correct subclass for you.
my $juniper = new SNMP::Info(
AutoSpecify => 1,
Debug => 1,
DestHost => 'myrouter',
Community => 'public',
Version => 2
)
or die "Can't connect to DestHost.\n";
my $class = $juniper->class();
print "SNMP::Info determined this device to fall under subclass : $class\n";
like, you just let it figure out what device you're on (that's the AutoSpecify), and it prints the subclass it landed on. main character energy, honestly. β¨
π DESCRIPTION π
this is the subclass for Juniper Devices running JUNOS. that's the vibe. that's the whole vibe.
πΈ Inherited Classes πΈ
SNMP::Info::Layer3β yeah she inherits from Layer3, as one does.
π Required MIBs π
bestie you're gonna need these loaded, no skipping:
JUNIPER-VLAN-MIBdated"200901090000Z"or later. (yes, it needs to be that one or newer, don't come at me with an old one π)JUNIPER-CHASSIS-DEFINES-MIBJUNIPER-MIBJUNIPER-VIRTUALCHASSIS-MIBJUNIPER-L2ALD-MIB
π§ Inherited Classes' MIBs π§
go check "Required MIBs" in SNMP::Info::Layer3 for its own MIB requirements, because she has her own needs too.
π GLOBALS π
these are the methods that return scalar values from SNMP. just one little value each. simple. elegant. iconic.
$juniper->vendor()β returns'juniper'. that's it. that's the whole method. π$juniper->os()β returns'junos'. slay.$juniper->layers()β checks the forwarding table for Layer 2 support, because some routers with switches do not report layers properly. like, they lie a little. so we check ourselves. π«Ά$juniper->os_ver()β returns the software version, extracted first from"sysDescr", or from"lldpLocSysDesc"if it's not available in"sysDescr".$juniper->model()β returns the model from"sysObjectID", with"jnxProductName"removed from the beginning. bye prefix. π$juniper->serial()β returns serial number. that comes from ("jnxBoxSerialNo").$juniper->mac()β returns the MAC address used by this bridge when it must be referred to in a unique fashion. from ("dot1dBaseBridgeAddress").$juniper->box_descr()β the name, model, or detailed description of the device. from ("jnxBoxDescr").$juniper->version()β pulls from ("jnxVirtualChassisMemberSWVersion").$juniper->vc_model()β pulls from ("jnxVirtualChassisMemberModel").
π Globals imported from SNMP::Info::Layer3 π
see the documentation in "GLOBALS" in SNMP::Info::Layer3 for the details, bestie.
π₯ TABLE METHODS π₯
these ones return tables of info β as a reference to a hash. so many hashes. we love a hash. π
$juniper->qb_fdb_index()β returns a reference to a hash: key = FDB ID, value = VLAN ID.$juniper->v_index()β returns ("jnxL2aldVlanTag") or ("jnxExVlanTag") depending upon switch software version.$juniper->v_name()β returns ("jnxL2aldVlanName") or ("jnxExVlanName") depending upon switch software version.$juniper->v_type()β returns ("jnxL2aldVlanType") or ("jnxExVlanType") depending upon switch software version.$juniper->i_trunk()β from ("jnxExVlanPortAccessMode").$juniper->i_vlan()β returns a mapping between"ifIndex"and the PVID or default VLAN.$juniper->i_vlan_membership()β returns a reference to a hash of arrays: key ="ifIndex", value = array of VLAN IDs. these are the VLANs which are members of the egress list for the port.$juniper->i_vlan_membership_untagged()β returns a reference to a hash of arrays: key ="ifIndex", value = array of VLAN IDs. these are the VLANs which are members of the untagged egress list for the port. (untagged!! different list!! don't mix them up π)$juniper->peth_port_ifindex()β returns a reference to a hash: key = PowerEthernet MIB interface number, value ="ifIndex". since Juniper does not provide a mapping function, this does it manually. for example,ge-0/0/1registers as PowerEthernet interface'1.2'. (manual labor, but make it cute π)
π¦ Pseudo ENTITY-MIB information π¦
these methods emulate the ENTITY-MIB Physical Table methods using JUNIPER-MIB and JUNIPER-VIRTUALCHASSIS-MIB. fake it till you make it, but accurately. β¨
$juniper->e_index()β returns a reference to a hash. Key: IID, Value: Integer, indices are combined into a eight digit integer, each index is two digits padded with leading zero if required.$juniper->e_class()β returns a reference to a hash. Key: IID, Value: General hardware type.$juniper->e_descr()β returns a reference to a hash. Key: IID, Value: Human friendly name.$juniper->e_hwver()β returns a reference to a hash. Key: IID, Value: Hardware version.$juniper->e_vendor()β returns a reference to a hash. Key: IID, Value: juniper.$juniper->e_serial()β returns a reference to a hash. Key: IID, Value: Serial number.$juniper->e_pos()β returns a reference to a hash. Key: IID, Value: The relative position among all entities sharing the same parent.$juniper->e_type()β returns a reference to a hash. Key: IID, Value: Type of component/sub-component as defined inJUNIPER-CHASSIS-DEFINES-MIB.$juniper->e_parent()β returns a reference to a hash. Key: IID, Value: The value ofe_index()for the entity which 'contains' this entity. a value of zero indicates this entity is not contained in any other entity.$entity->e_fru()β BOOLEAN. Is a Field Replaceable unit? comes from ("entPhysicalFRU").
β Table Methods imported from SNMP::Info::Layer3 β
see the documentation in "TABLE METHODS" in SNMP::Info::Layer3 for the details, bestie.
π reminder: this all came fromperl v5.40.1, dated2026-02-28. that's your version and your date, don't forget them. π«Ά
and that's the whole page!! go forth and SNMP responsibly, queen. πβ¨π
π¦ 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