Solved

Parser for NXOS Radius Groups

  • 3 February 2023
  • 4 replies
  • 77 views

Userlevel 1

I am having issue creating a parser for NXOS radius groups.   We recently migrated from one set of radius servers to another.   I would like to be able to parse the AAA groups and pull out the group name, servers part of the group, and any particular settings.   

aaa group server radius radius 
    server 10.1.2.3
    server 10.1.2.4 
    deadtime 0
    use-vrf default
    no source-interface
aaa group server radius Active-AAA 
    server 10.2.3.4
    server 10.2.3.5 
    deadtime 0
    use-vrf default
    source-interface mgmt0

Seems like no matter what I do the parser will only pull first svr configured.    

icon

Best answer by kevinbenner 5 February 2023, 13:39

View original

4 replies

Userlevel 1

I was able to get what I needed.   Although I would still like alternate methods.  

I used a paragraph parser for a CLI command and not the Config.   

Command: show radius-server

ID Line Pattern: 

regex[$string:radSvr]:(\d+.\d+.\d+.\d+):

This regex matched the IP address only, follow by colon.   

Rest simple variables.    


I just wonder if there is an easier way to pull repeating lines out like in the example in OP.   With 2 servers in the group.  

 

 

MyStupidSwitch-1#show radius-server

Global Radius shared secret:********
timeout value:5
retransmission count:1
deadtime value:0
source interface:any available
total number of servers:2

following RADIUS servers are configured:
    10.2.3.4:
        available for authentication on port: 1812
        available for accounting on port: 1813
        Radius shared secret:********
        timeout:5
        retries:1
    10.2.3.5:
        available for authentication on port: 1812
        available for accounting on port: 1813
        Radius shared secret:********
        timeout:5
        retries:1
 

One method for this, would be to use 2 paragraphs, and make one the parent of the other.

See attached parser for a full example.

First, use a paragraph to identify your groups:

 

Next, make a second paragraph, which calls the first paragraph as its parent:

 

Userlevel 1

Thank you very much.   I will try that shortly and report back.  

Userlevel 1

Worked perfectly!   Thanks again 

Reply


Community |  Ideas

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