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:
- type (numeric,
cbgpPeer2Type) - address length (in bytes:
4for IPv4,16for IPv6) - 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
- 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