SNMP::...scoBGP(3pm)

✨ SNMP::Info::CiscoBGP ✨

okay bestie, welcome to SNMP::Info::CiscoBGP β€” she's a Perl module, she lives in the SNMP namespace under the SNMP::Info family (that's the manual name, if you were wondering where the header went πŸ’…), and she's your SNMP interface to Cisco's BGP MIBs. Yes, that BGP. The routing one. Iconic behavior honestly.

Written by Alexander Hartmaier btw β€” credit where credit is due, we love an author 🫢


🌸 SYNOPSIS 🌸

# Let SNMP::Info determine the correct subclass for you.
my $device = SNMP::Info->(
    AutoSpecify => 1,
    Debug       => 1,
    DestHost    => 'myswitch',
    Community   => 'public',
    Version     => 2 ) or die "Can't connect to DestHost.\n";

my $remoteas_for_index = $device->cisco_bgp_peer2_remoteas;

for my $index (keys $remoteas_for_index->%*) {
    my ($type, $addrlength, $ip) =
        $device->parse_cisco_bgp_peer2_entry_index($index);
    printf('remote: %-39s  type: %-4s  remote AS: %5d',
        $ip, $type, $remoteas_for_index->{$index}); }

no cap, that's the whole vibe. connect, grab the remote AS map, loop the keys, parse each index, print. slay.


πŸ¦‹ DESCRIPTION πŸ¦‹

SNMP::Info::CiscoBGP is a subclass of SNMP::Info that hands you the tea on a cisco device's BGP configuration and its current state. two for one. we love that.

Use it β€” or create it β€” inside a subclass of SNMP::Info. Do not use directly. fr fr. she's not a main character who works solo, she needs her parent class.

🌈 Inherited Classes

none. she's self-made. periodt.

🧚 Required MIBs

  • CISCO-BGP4-MIB

that's it. that's the list. she's low maintenance πŸ’–


πŸ‘‘ GLOBALS πŸ‘‘

None

literally none. moving on.


πŸ’… TABLE METHODS πŸ’…

πŸ“ Cisco BGP Peer 2 Table (cbgpPeer2Table)

This table contains, one entry per BGP peer, information about the connections with BGP peers. one entry, one peer, all the deets.

  • cisco_bgp_peer2_state (cbgpPeer2State)
  • cisco_bgp_peer2_adminstatus (cbgpPeer2AdminStatus)
  • cisco_bgp_peer2_localaddr (cbgpPeer2LocalAddr)
  • cisco_bgp_peer2_localport (cbgpPeer2LocalPort)
  • cisco_bgp_peer2_localas (cbgpPeer2LocalAs)
  • cisco_bgp_peer2_localidentifier (cbgpPeer2LocalIdentifier)
  • cisco_bgp_peer2_remoteport (cbgpPeer2RemotePort)
  • cisco_bgp_peer2_remoteas (cbgpPeer2RemoteAs)
  • cisco_bgp_peer2_remoteidentifier (cbgpPeer2RemoteIdentifier)
  • cisco_bgp_peer2_inupdates (cbgpPeer2InUpdates)
  • cisco_bgp_peer2_outupdates (cbgpPeer2OutUpdates)
  • cisco_bgp_peer2_intotalmessages (cbgpPeer2InTotalMessages)
  • cisco_bgp_peer2_outtotalmessages (cbgpPeer2OutTotalMessages)
  • cisco_bgp_peer2_lasterror (cbgpPeer2LastError)
  • cisco_bgp_peer2_fsmestablishedtransitions (cbgpPeer2FsmEstablishedTransitions)
  • cisco_bgp_peer2_fsmestablishedtime (cbgpPeer2FsmEstablishedTime)
  • cisco_bgp_peer2_connectretryinterval (cbgpPeer2ConnectRetryInterval)
  • cisco_bgp_peer2_holdtime (cbgpPeer2HoldTime)
  • cisco_bgp_peer2_keepalive (cbgpPeer2KeepAlive)
  • cisco_bgp_peer2_holdtimeconfigured (cbgpPeer2HoldTimeConfigured)
  • cisco_bgp_peer2_keepaliveconfigured (cbgpPeer2KeepAliveConfigured)
  • cisco_bgp_peer2_minasoriginationinterval (cbgpPeer2MinASOriginationInterval)
  • cisco_bgp_peer2_inupdatelapsedtime (cbgpPeer2InUpdateElapsedTime)
  • cisco_bgp_peer2_lasterrortxt (cbgpPeer2LastErrorTxt)
  • cisco_bgp_peer2_prevstate (cbgpPeer2PrevState)

look at that lineup. 25 methods, all serving looks πŸ”₯

🌸 Cisco BGP Peer 2 Address Family Prefix Table (cbgpPeer2AddrFamilyPrefixTable)

This table contains prefix related information related to address families supported by a peer. basically: how many prefixes is this peer doing things with, and what are they.

  • cisco_bgp_peer2_acceptedprefixes (cbgpPeer2AcceptedPrefixes)
  • cisco_bgp_peer2_deniedprefixes (cbgpPeer2DeniedPrefixes)
  • cisco_bgp_peer2_prefixadminlimit (cbgpPeer2PrefixAdminLimit)
  • cisco_bgp_peer2_prefixthreshold (cbgpPeer2PrefixThreshold)
  • cisco_bgp_peer2_prefixclearthreshold (cbgpPeer2PrefixClearThreshold)
  • cisco_bgp_peer2_advertisedprefixes (cbgpPeer2AdvertisedPrefixes)
  • cisco_bgp_peer2_suppressedprefixes (cbgpPeer2SuppressedPrefixes)
  • cisco_bgp_peer2_withdrawnprefixes (cbgpPeer2WithdrawnPrefixes)

πŸŽ€ METHODS πŸŽ€

parse_cisco_bgp_peer2_entry_index

bestie this is the lil decoder ring πŸ”‘

Takes a cbgpPeer2Entry index as returned by all methods of the Cisco BGP Peer 2 Table methods.

Returns a list of:

  1. type (numeric, cbgpPeer2Type)
  2. address length (in bytes: 4 for IPv4, 16 for IPv6)
  3. the remote IP address as string

so like, the index is all smooshed together and this method un-smooshes it for you. iykyk. so helpful of her honestly 😭


that's the whole page! shipped as part of the User Contributed Perl Documentation, running on perl v5.40.1 and dated 2026-02-28. go forth, poll your BGP peers, and remember: do NOT use this class directly, only in a subclass. bye bestie πŸ¦‹βœ¨πŸ’–

πŸ“¦ where this page comes from