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-MIB dated "200901090000Z" or later. (yes, it needs to be that one or newer, don't come at me with an old one πŸ™ˆ)
  • JUNIPER-CHASSIS-DEFINES-MIB
  • JUNIPER-MIB
  • JUNIPER-VIRTUALCHASSIS-MIB
  • JUNIPER-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/1 registers 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 in JUNIPER-CHASSIS-DEFINES-MIB.
  • $juniper->e_parent() β€” returns a reference to a hash. Key: IID, Value: The value of e_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 from perl v5.40.1, dated 2026-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