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.
Page 1 / 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
Hi,
Need to parse the nexus devices configuration such as
BGP
OSPF
Standard ACL
Extended ACL
MSDP
IP PREFIX-LIST
Compliance Check such as NTP, SYSLOG, SSH, AAA, LINE VTY, CONSOLE
Any update
@Carsten.Schmidt - Can you share the parser for below points for nexus devices
BGP configuration
OSPF configuration
Standard ACL
Extended ACL
MSDP configuration
IP PREFIX-LIST
Compliance Check such as NTP, SYSLOG, SSH, AAA, LINE VTY, CONSOLE
@harishchandras Go to Parser Library and search for Nexus. There is stuff on OSPF BGP etc.
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.
mregexe$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.
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.
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.
Thanks @sattaluri & @pradeep.gaddameedi for prompt response. Nexus line vty parser issue resolved.
Can you share all parsers you have for cisco nexus devices.
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+