10-25-2011 03:09 AM
I'm trying to monitor BGP routes in my table, both received and actually active, for both IPv4 and IPv6 via SNMP. However I can't seem to find the correct OIDs.
This is the values I'm trying to get:
Table Tot Paths Act Paths Suppressed History Damp State Pending
inet.0 844332 373952 0 0 0 0
inet6.0 12751 7158 0 0 0 0
I've attemptedf to even run an snampwalk of the entire mib and grep for these values, but I'm not having any success. Anyone have any ideas?
It would also be nice to monitor via SNMP the amount of bgp peers and down peers at any moment in time.
10-27-2011 07:06 AM
Please check on you device jnxBgpM2PrefixCountersTable and compare to CLI results:
admin@s1> show snmp mib walk jnxBgpM2PrefixCountersTable jnxBgpM2PrefixCountersAfi.0.2.1 = 2 jnxBgpM2PrefixCountersAfi.1.1.1 = 1 jnxBgpM2PrefixCountersAfi.2.1.1 = 1 jnxBgpM2PrefixCountersAfi.3.2.1 = 2 jnxBgpM2PrefixCountersSafi.0.2.1 = 1 jnxBgpM2PrefixCountersSafi.1.1.1 = 1 jnxBgpM2PrefixCountersSafi.2.1.1 = 1 jnxBgpM2PrefixCountersSafi.3.2.1 = 1 jnxBgpM2PrefixInPrefixes.0.2.1 = 0 jnxBgpM2PrefixInPrefixes.1.1.1 = 0 jnxBgpM2PrefixInPrefixes.2.1.1 = 4 jnxBgpM2PrefixInPrefixes.3.2.1 = 1 jnxBgpM2PrefixInPrefixesAccepted.0.2.1 = 0 jnxBgpM2PrefixInPrefixesAccepted.1.1.1 = 0 jnxBgpM2PrefixInPrefixesAccepted.2.1.1 = 4 jnxBgpM2PrefixInPrefixesAccepted.3.2.1 = 1 jnxBgpM2PrefixInPrefixesRejected.0.2.1 = 0 jnxBgpM2PrefixInPrefixesRejected.1.1.1 = 0 jnxBgpM2PrefixInPrefixesRejected.2.1.1 = 1 jnxBgpM2PrefixInPrefixesRejected.3.2.1 = 1 jnxBgpM2PrefixOutPrefixes.0.2.1 = 1 jnxBgpM2PrefixOutPrefixes.1.1.1 = 4 jnxBgpM2PrefixOutPrefixes.2.1.1 = 0 jnxBgpM2PrefixOutPrefixes.3.2.1 = 0 table index: jnxBgpM2PeerIndex, jnxBgpM2PrefixCountersAfi, jnxBgpM2PrefixCountersSafi // my peers: admin@s1> show snmp mib walk jnxBgpM2PeerIndex jnxBgpM2PeerIndex.184.108.40.206.0.1.1.12.0.0.2 = 1 jnxBgpM2PeerIndex.220.127.116.11.18.104.22.168.0.18.0.0.0.0
.0.0.0.1.22.214.171.124.126.96.36.199.188.8.131.52.0.0.0.0.2 = 0 jnxBgpM2PeerIndex.184.108.40.206.0.2.1.12.0.0.1 = 2 jnxBgpM2PeerIndex.220.127.116.11.18.104.22.168.0.18.0.0.0.0 .0.0.0.2.22.214.171.124.126.96.36.199.188.8.131.52.0.0.0.0.1 = 3 admin@s1> show bgp summary Groups: 2 Peers: 4 Down peers: 0 Peer AS InPkt OutPkt OutQ Flaps Last Up/Dwn State|#Active/Received/Accepted/Damped... 184.108.40.206 65001 24502 24501 0 0 1w0d17h Establ VR2.inet.0: 3/4/4/0 220.127.116.11 65002 24501 24503 0 0 1w0d17h Establ VR1.inet.0: 0/0/0/0 2001:db8:0:12::1 65001 24500 24500 0 0 1w0d17h Establ VR2.inet6.0: 0/1/1/0 2001:db8:0:12::2 65002 24500 24501 0 0 1w0d17h Establ VR1.inet6.0: 0/0/0/0
It's not direct replacement for CLI, but jnxBgpM2PrefixInPrefixesAccepted and jnxBgpM2PrefixInPrefixesRejected should give you a start. As with any SNMP MIBs you have to play with table indexes.
Example of Nagios pluging to check this SNMP OIDs: http://email@example.com
10-27-2011 07:12 AM
Thanks for the reply.
Is it not possible to get the values out from a regular iso value? Such as:
snmpwalk -v 2c -c <community> <router> .18.104.22.168.4.1.2622.214.171.124.126.96.36.199.0.0
Which would then give me a digit value that I can graph? I must admit my mib knowledge is pretty poor as I've only recently started to use Cacti (which is where I'm trying to graph this stuff)
10-27-2011 07:30 AM
my suggestion was to first check the SNMP counters with Junos CLI to make sure it has any value to you. If you need to know the numerical OID values for the jnxBgpM2 tree, the easy way is to look at:
Please experiment with the snmpwalk a bit. Google shows an old discussion about Cacti and jnxBgpM2, not sure if it will help you.
10-27-2011 07:53 AM
I've been through a bunch and most work, but the particular one I'm looking for seems to be one that isn't working at all:
firstname.lastname@example.org> show snmp mib walk jnxBgpM2Rib
10-27-2011 08:08 AM
who said jnxBgpM2Rib will work ? show snmp mib walk jnxBgpM2 to see what's implemented . Why do you think you need jnxBgpM2Rib ? Do you want to dump full BGP table with SNMP ? Not good idea with big number of o prefixes.
10-27-2011 08:59 AM
I would assume jnxBgpM2Rib would work as that's exactly the information I'm trying to get out. I need to see the BGP RIB table. Hence jnxBgpM2Rib shows it to be the cloeset option.
I've grepped an output of jnxBgpM2 and it does not give me any of the values I actually need
10-27-2011 01:49 PM
There is poor support for SNMP on ipv6 BGP, back in 2007 there was a fair amount of community support for ipv6 snmp for BGP but has fallen off. I have not found a OID that is useful and returns anything with the Juniper routers for IPv6. For IPv4 this is what I have found:
BGP peer local addr OID: 188.8.131.52.184.108.40.206.1.5
BGP peer state OID: 220.127.116.11.18.104.22.168.1.2
BGP remote AS OID: 22.214.171.124.126.96.36.199.1.9
BGP remote IP OID: 188.8.131.52.184.108.40.206.1.7
Tested with Junos 10.4.R7.5 with MX80s and J series.
Hope this helps.
10-27-2011 04:45 PM
mellowd - I'm not convinced you need jnxBgpM2Rib - which OIDs you would like to see ? Do you want to see all route entries ? Or just number of BGP routes ?
In the initial question you asked about getting counters similar to Tot Paths / Act Paths (output of 'show bgp group' ) + state of peers. It seems to be possible with jnxBgpM2 - just keep in mind it has per BGP peer counters (not total).
If I miss the point please share the 'show snmp mib walk jnxBgpM2PrefixCountersTable' and 'show bgp group/summary' output.
dclarkjr1122 - please notice my example showed output for both IPv4 and IPv6 peers. Check if jnxBgpM2 will help you.
10-28-2011 01:27 AM
I would indeed like to see total paths received and total active paths. jnxBgpM2 does have peer counters, but as you mentioned you only get peer counters, not a total. It's frustrating that JUNOS won't give you total counters for both.
I can't post those outputs as I have over 320 peers on this router so I get a very long result.
Is there a way to somehow then extract the peer counters, add them together and get that into Cacti?
10-28-2011 02:37 AM
I can't help you with Cacti configuration but it's possible to get all peer counters, post-process it and show the totals - all in Cacti. I'm afraid handling SNMP table indexes will be the most complex part of the task.
And keep in mind BGP tables ! = RIB (routes accepted but not active/etc).
If you want to check just the number of IPv4/IPv6 prefixes in net.0/inet6.0, take a look at OIDs ipCidrRouteNumber.0 and ipv6RouteNumber.0 - test with show snmp mib get XXX.
10-28-2011 08:35 AM
JTB: Thanks, I totoally missed the link that pointed out the OIDs. I have added them to our collector. I have to add the pollers via OID - thus I try to ignore just looking for the MIB and focus on the definitions.