Junos OS

last person joined: yesterday 

Ask questions and share experiences about Junos OS.
Expand all | Collapse all

BGP IPv4 and IPv6 monitoring

  • 1.  BGP IPv4 and IPv6 monitoring

    Posted 10-25-2011 03:09

     

    Hi all.

     

    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.

     

    Thanks



  • 2.  RE: BGP IPv4 and IPv6 monitoring

    Posted 10-27-2011 01:13

    Does no-one monitor this kind of thing at all?



  • 3.  RE: BGP IPv4 and IPv6 monitoring

     
    Posted 10-27-2011 07:06

    hi mellowd,

     

    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.6.1.12.0.0.1.1.12.0.0.2 = 1
    jnxBgpM2PeerIndex.6.2.32.1.13.184.0.0.0.18.0.0.0.0.0.0.0.1.2.32.1.13.184.0.0.0.18.0.0.0.0.0.0.0.2 = 0
    jnxBgpM2PeerIndex.7.1.12.0.0.2.1.12.0.0.1 = 2
    jnxBgpM2PeerIndex.7.2.32.1.13.184.0.0.0.18.0.0.0.0.0.0.0.2.2.32.1.13.184.0.0.0.18.0.0.0.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...
    12.0.0.1              65001      24502      24501       0       0     1w0d17h Establ
      VR2.inet.0: 3/4/4/0
    12.0.0.2              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. 

     

    Full MIB definition: http://www.juniper.net/techpubs/en_US/junos11.2/topics/reference/mibs/mib-jnx-bgpmib2.txt

     

    Example of Nagios pluging to check this SNMP OIDs: nagios-users@lists.sourceforge.net/msg07498.html" rel="nofollow noopener noreferrer">http://www.mail-archive.com/nagios-users@lists.sourceforge.net/msg07498.html

    jtb



  • 4.  RE: BGP IPv4 and IPv6 monitoring

    Posted 10-27-2011 07:13

    Hi jtb.

     

    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> .1.3.6.1.4.1.2636.3.1.13.1.5.6.1.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)

     

    Thanks



  • 5.  RE: BGP IPv4 and IPv6 monitoring

     
    Posted 10-27-2011 07:31

    hi,

     

    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: 

     

    http://www.oidview.com/mibs/2636/BGP4-V2-MIB-JUNIPER.html

     

    Please experiment with the snmpwalk a bit. Google shows an old discussion about Cacti and jnxBgpM2, not sure if it will help you.

    jtb



  • 6.  RE: BGP IPv4 and IPv6 monitoring

    Posted 10-27-2011 07:53

    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:

     

    darren@pgr1.the1> show snmp mib walk jnxBgpM2Rib

    darren@pgr1.the1>



  • 7.  RE: BGP IPv4 and IPv6 monitoring

     
    Posted 10-27-2011 08:09

    hi, 

     

    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.

    jtb

     

     



  • 8.  RE: BGP IPv4 and IPv6 monitoring

    Posted 10-27-2011 09:00

    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   



  • 9.  RE: BGP IPv4 and IPv6 monitoring

     
    Posted 10-27-2011 16:45

    hi all,

     

    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.

    jtb



  • 10.  RE: BGP IPv4 and IPv6 monitoring

    Posted 10-28-2011 01:27

    Hi jtb.

     

    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?

     

     



  • 11.  RE: BGP IPv4 and IPv6 monitoring

     
    Posted 10-28-2011 02:38

    hi,

     

    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.

    jtb

     



  • 12.  RE: BGP IPv4 and IPv6 monitoring

    Posted 10-28-2011 08:35

    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.

    Thanks agian,

     

     



  • 13.  RE: BGP IPv4 and IPv6 monitoring

    Posted 10-31-2011 07:17

    Not been able to test this out, work is real busy.

     

    I'll get back to you and let you know how things went



  • 14.  RE: BGP IPv4 and IPv6 monitoring

    Posted 11-06-2011 11:23

    Dear JTB and all,

     

    Sorry to divert the topic, would you share me the good doc to understand output of the sh snmp mib walk _____ .

     

    regards

    Gaurav Jhawar



  • 15.  RE: BGP IPv4 and IPv6 monitoring

    Posted 10-27-2011 13:50

    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: 1.3.6.1.2.1.15.3.1.5

    BGP peer state             OID: 1.3.6.1.2.1.15.3.1.2

    BGP remote AS            OID: 1.3.6.1.2.1.15.3.1.9

    BGP remote IP              OID: 1.3.6.1.2.1.15.3.1.7

     

    Tested with Junos 10.4.R7.5 with MX80s and J series.

    Hope this helps.