Antonio Piepoli (apiepoli)
2015-08-19 16:08:41 UTC
Hello everybody,
I am Antonio and I am trying to solve a problem using net-snmp and pass_persist (with python). I would ask your support/opinion on this.
There is a former implementation of the BGP MIB(1.3.6.1.2.1.15.3.1.2) on some Cisco routers that stores all the information about all the BGP peers (in all the VRFs). In the new IOS XR this is not happening. In particular the BGP MIB now stores only the information about the peers in the global routing table of the router (so it does not store information about the peers in other VRFs). To address this a new MIB was created: CISCO-BGP4-MIB(.1.3.6.1.4.1.9.9.187). This MIB does not replicate the same behavior of the former BGP MIB. This MIB is context aware and therefore is necessary to configure on the routers multiple contexts; to map the context to a VRF and at the end to map a community to a context. At the end querying the device on the community that is mapped to a VRF through a context I am able to get the BGP peers in that VRF.
Long story short I am trying to emulate the former behavior of the BGP MIB. In particular my idea is to, through a proxy, intercept the query and run a script that collects all the information, querying over all the communities, and returns the concatenation of the content of the tree over all the communities(vrfs).
I am using net-snmp as proxy and pass_persist to call a python script that populates the tree like the former bgp MIB.
More or less the conf is (omitting all the auth stuffs):
pass_persist .1.3.6.1.3.60 /home/ciscolab/CiscobgpMIB_router1.py
pass_persist .1.3.6.1.3.70 /home/ciscolab/CiscobgpMIB_router2.py
com2sec -Cn ctx notConfigUser default fakecomm
com2sec -Cn ctx2 notConfigUser default fakecomm2
proxy -Cn ctx -v 2c -c public <IP ROUTER 1> 1.3
proxy -Cn ctx -v 2c -c public localhost .1.3.6.1.4.1.9.9.187 .1.3.6.1.3.60
proxy -Cn ctx2 -v 2c -c public <IP ROUTER 2> 1.3
proxy -Cn ctx2 -v 2c -c public localhost .1.3.6.1.4.1.9.9.187 .1.3.6.1.3.70
So far I was able to perform this concatenation for the CISCO-BGP4-MIB but not for the BGP MIB.
In order to perform the concatenation for the BGP MIB I would so something like:
pass_persist .1.3.6.1.3.61 /home/ciscolab/bgpMIB_router1.py
pass_persist .1.3.6.1.3.71 /home/ciscolab/bgpMIB_router2.py
proxy -Cn ctx -v 2c -c public localhost .1.3.6.1.2.1.15.3.1.2 .1.3.6.1.3.61
proxy -Cn ctx2 -v 2c -c public localhost .1.3.6.1.2.1.15.3.1.2 .1.3.6.1.3.71
But is not working. Is there any sort of mechanism that prevents the proxy to work on standard MIBS? If I change to .1.4.6.1.2.1.15.3.1.2 it works without modifying anything else.
Any Idea?
Thanks a lot
Antonio Piepoli
NCE - Network Consulting Engineer.
***@cisco.com
Phone: +39 06 5164 5047
Cisco Systems Limited
[Loading Image...
]
I am Antonio and I am trying to solve a problem using net-snmp and pass_persist (with python). I would ask your support/opinion on this.
There is a former implementation of the BGP MIB(1.3.6.1.2.1.15.3.1.2) on some Cisco routers that stores all the information about all the BGP peers (in all the VRFs). In the new IOS XR this is not happening. In particular the BGP MIB now stores only the information about the peers in the global routing table of the router (so it does not store information about the peers in other VRFs). To address this a new MIB was created: CISCO-BGP4-MIB(.1.3.6.1.4.1.9.9.187). This MIB does not replicate the same behavior of the former BGP MIB. This MIB is context aware and therefore is necessary to configure on the routers multiple contexts; to map the context to a VRF and at the end to map a community to a context. At the end querying the device on the community that is mapped to a VRF through a context I am able to get the BGP peers in that VRF.
Long story short I am trying to emulate the former behavior of the BGP MIB. In particular my idea is to, through a proxy, intercept the query and run a script that collects all the information, querying over all the communities, and returns the concatenation of the content of the tree over all the communities(vrfs).
I am using net-snmp as proxy and pass_persist to call a python script that populates the tree like the former bgp MIB.
More or less the conf is (omitting all the auth stuffs):
pass_persist .1.3.6.1.3.60 /home/ciscolab/CiscobgpMIB_router1.py
pass_persist .1.3.6.1.3.70 /home/ciscolab/CiscobgpMIB_router2.py
com2sec -Cn ctx notConfigUser default fakecomm
com2sec -Cn ctx2 notConfigUser default fakecomm2
proxy -Cn ctx -v 2c -c public <IP ROUTER 1> 1.3
proxy -Cn ctx -v 2c -c public localhost .1.3.6.1.4.1.9.9.187 .1.3.6.1.3.60
proxy -Cn ctx2 -v 2c -c public <IP ROUTER 2> 1.3
proxy -Cn ctx2 -v 2c -c public localhost .1.3.6.1.4.1.9.9.187 .1.3.6.1.3.70
So far I was able to perform this concatenation for the CISCO-BGP4-MIB but not for the BGP MIB.
In order to perform the concatenation for the BGP MIB I would so something like:
pass_persist .1.3.6.1.3.61 /home/ciscolab/bgpMIB_router1.py
pass_persist .1.3.6.1.3.71 /home/ciscolab/bgpMIB_router2.py
proxy -Cn ctx -v 2c -c public localhost .1.3.6.1.2.1.15.3.1.2 .1.3.6.1.3.61
proxy -Cn ctx2 -v 2c -c public localhost .1.3.6.1.2.1.15.3.1.2 .1.3.6.1.3.71
But is not working. Is there any sort of mechanism that prevents the proxy to work on standard MIBS? If I change to .1.4.6.1.2.1.15.3.1.2 it works without modifying anything else.
Any Idea?
Thanks a lot
Antonio Piepoli
NCE - Network Consulting Engineer.
***@cisco.com
Phone: +39 06 5164 5047
Cisco Systems Limited
[Loading Image...