CiscoTestAutomation / genieparser

sub-component of Genie that parse the device output into structured datastructure
Apache License 2.0
248 stars 385 forks source link

ios-xr parser issue - "show bgp instance {instance} all all" #673

Open lukasnbm opened 2 years ago

lukasnbm commented 2 years ago

Hi PyATS Team,

I have some issue with xr parsershow bgp instance {instance} all all. It seems that the parser cannot catch some of the bgp description, here are the sample output from the router:

RP/0/RSP1/CPU0:border-east.1#show bgp instance default all all neighbors detail

BGP neighbor is 36.92.255.81
 Remote AS 7789, local AS 24567, external link
 Description: E-BGP peer to IX (via PE-Kali) 

---- SNIPPED ----

BGP neighbor is 114.122.128.2
 Remote AS 24567, local AS 24567, internal link
 Description: border-east.2_IPv4 

As you can see both the neighbor have their own description information.

But the parser cannot catch the first neighbor description. Here are the sample output from the parser:

                                                           '36.92.255.81': {'address_family': {'ipv4 unicast': {'accepted_prefixes': 890392,
---- SNIPPED ---
                                                                            'enforcing_first_as': 'enabled',
                                                                            'holdtime': 180,
                                                                            'inbound_message': '3',

---- SNIPPED ---
                                                          '114.122.128.2': {'address_family': {'ipv4 unicast': {'accepted_prefixes': 69735,

                                                                             'description': 'border-east.2_IPv4',
                                                                             'holdtime': 180,
                                                                             'inbound_message': '3',

As you can see the second peer has the description field but the first one doesn't.

Maybe the parser has some issue catching the description with parentheses or all kind of bracket, as the first neighbor has it on the description but I am not really sure about that.

If you need another extra information about this issue please let me now.

Thank you.

omehrabi commented 2 years ago

Hi, thank you for for finding issue. pyats is an open source and we encourage users to contribute to it. since you found the issue you could resolve and create a pr and then we could merge it into pyats

lukasnbm commented 2 years ago

Hi @omehrabi ,

As I still don't have any experience with git process. Can you guys please kindly fix the issue and put it on the next release?

lukasnbm commented 2 years ago

Hi @omehrabi ,

Are there any update regarding this issue? Or maybe the team is still working on it?

Thank you.

omehrabi commented 2 years ago

Hi this is not a git issue here is the documnentation for writing a parser: https://pubhub.devnetcloud.com/media/pyats-development-guide/docs/writeparser/writeparser.html if still after reading the documentation you are not able to fix the issue, we will add it to workload.

lukasnbm commented 2 years ago

Hi @omehrabi,

I have been trying to follow that website since our last interaction (around 14 days ago) but still not able to create the solution. Could you please add it to the workload?

omehrabi commented 2 years ago

ok sure. please provide the device output and the issue and we will fix it. I could not say when it would be available since we are shot handed at the moment and this is not a blocker

lukasnbm commented 2 years ago

Thank you very much @omehrabi ,

I have some issue with xr parser show bgp instance {instance} all all. It seems that the parser cannot catch some of the bgp description. Here are the sample output from the router:

RP/0/RSP1/CPU0:border-east.1#show bgp instance default all all neighbors detail

BGP neighbor is 36.92.255.81
 Remote AS 7789, local AS 24567, external link
 Description: E-BGP peer to IX (via PE-Kali) 

---- SNIPPED ----

BGP neighbor is 114.122.128.2
 Remote AS 24567, local AS 24567, internal link
 Description: border-east.2_IPv4 

As you can see both the neighbor have their own description information.

But the parser cannot catch the first BGP neighbor description. Here are the sample output from the parser:

                                                           '36.92.255.81': {'address_family': {'ipv4 unicast': {'accepted_prefixes': 890392,
---- SNIPPED ---
                                                                            'enforcing_first_as': 'enabled',
                                                                            'holdtime': 180,
                                                                            'inbound_message': '3',

---- SNIPPED ---
                                                          '114.122.128.2': {'address_family': {'ipv4 unicast': {'accepted_prefixes': 69735,

                                                                             'description': 'border-east.2_IPv4',
                                                                             'holdtime': 180,
                                                                             'inbound_message': '3',

As you can see the second neighbor has the description field but the first one doesn't.

Maybe the parser has some issue catching the description with parentheses or all kind of bracket, as the first neighbor has it on the description field.