Question

Parsers for Cisco Nexus Devices

  • 5 January 2024
  • 13 replies
  • 199 views

Badge +1

Does anyone have device configuration breakup parser for cisco nexus devices.

I see it available for cisco router devices but can’t be use for cisco nexus devices since catalyst devices configurations by exclamation (!) but same is not available in case of cisco nexus devices. 


13 replies

Userlevel 4
Badge +1

Hi @harishchandras,

 

could you please be a little bit more precise in your request? I have 24 Cisco Nexus parser in my Netbrain installation.

Carsten

Badge +1

Hi,

Need to parse the nexus devices configuration such as 

  1. BGP
  2. OSPF
  3. Standard ACL
  4. Extended ACL
  5. MSDP
  6. IP PREFIX-LIST
  7. Compliance Check such as NTP, SYSLOG, SSH, AAA, LINE VTY, CONSOLE
Badge +1

Any update

Badge +1

@Carsten.Schmidt - Can you share the parser for below points for nexus devices

  1. BGP configuration
  2. OSPF configuration
  3. Standard ACL
  4. Extended ACL
  5. MSDP configuration
  6. IP PREFIX-LIST
  7. Compliance Check such as NTP, SYSLOG, SSH, AAA, LINE VTY, CONSOLE
Userlevel 4
Badge +1

@harishchandras Go to Parser Library and search for Nexus. There is stuff on OSPF BGP etc.
 

 

Badge +1

i didn’t found it on All parser and hence asking for help. I guess you didn’t understand my query. I want to build the compliance check network intent for nexus devices. I am unable to parse the bgp config from nexus devices configuration. let me know if you have it.

@harishchandras 

The exclamation mark "!" is a delimiter that is easy to parse in Cisco IOS, but in Nexus, there is no such delimiter, so in order to pass the BGP configuration, we can use regex.

mregex[$bgp]:^(router bgp .*?)(?=^\S+)

This regex pattern will match lines that start with "router bgp" followed by any characters until the next line that doesn't start with whitespace (indicating the end of the BGP router configuration block).

Here's a breakdown of the regex pattern:

^: Matches the beginning of a line.

(router bgp .*?): This part captures the string "router bgp" followed by any characters (denoted by .*?). The .*? is a non-greedy match, meaning it will match as few characters as possible before the next part of the pattern.

(?=^\S+): This is a positive lookahead assertion ((?= ... )). It ensures that the matched string is followed by a line that starts with a non-whitespace character (^\S+), indicating the end of the BGP router configuration block.

This type of parsing logic will be useful to parse any similar kind of patterns in nexus.

Badge +1

Thanks @sattaluri, It’s works for BGP. I tried same regex for line vty/console line but when i added one column to get vty name. it's not working. Can you let me know where i am wrong ?

 

@harishchandras 

End of the Paragraph: regex:^\S

The regular expression ^\S matches the beginning of a line (^) followed by a single non-whitespace character (\S). Here's a breakdown:

  • ^: Asserts the start of the line.
  • \S: Matches a single non-whitespace character.

So, this regex would match any string that starts with exactly one with non-whitespace character. For example, it would match "l" in line and "b" in boot, etc.

Userlevel 2
Badge

Hello Harischandra,

 

As an alternate, you can try to extract configuration sectionally. NX-OS has capability to show configuration sectionally for example, you can use command “show running bgp” to get bgp configuration. In this case, the advantage is, you can use NetBrain’s visual parsers.

 

Below is sample intent screenshot.

 

I hope this is helpful.

Badge +1

Thanks @sattaluri & @pradeep.gaddameedi for prompt response. Nexus line vty parser issue resolved.

Can you share all parsers you have for cisco nexus devices.

Badge +1

Need to parse below config. Any suggestions on how to do this ?

 

sw01#show running-config tacacs


!Command: show running-config tacacs+
!Running configuration last done at: Mon May 20 05:33:15 2024
!Time: Tue May 21 20:54:04 2024

version 7.0(3)I7(8) Bios:version 5.3.1 
feature tacacs+

tacacs-server key 7 "XXXX"
tacacs-server host X.X.X.X
tacacs-server host X.X.X.X
tacacs-server host X.X.X.X
tacacs-server host X.X.X.X

aaa group server tacacs+ TACGRPSERVER 
    server X.X.X.X 
    server X.X.X.X 
    server X.X.X.X 
    server X.X.X.X 
    use-vrf XXX
    source-interface VVVV

@harishchandras 

We can parse the data in two different ways with NetBrain Visual Parser: "Paragraph" and "Variable."

Reply


Community |  Ideas

Facebook |  Instagram |  Youtube |  Twitter |  LinkedIn
Privacy & Security Statement  |  Terms & Conditions |  Impressum  |  UK Modern Slavery Statement