cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1188
Views
5
Helpful
2
Replies

Using Moquery to obtain specific static routes from L3Out

AukeyPeach
Level 1
Level 1

Hello!

 

I've been tasked with finding L3Out static routes from all of our tenants on the fabric - The data needs to be specific to a set of nodes.

 

At the moment we have around 100 or so tenants with quite a few static routes per tenant. So there is a fair chunk of data to obtain.

 

The data I need:

Specific Nodes (Lets for the sake of this question call them Nodes-A and B which are in VPC) 

IP address 

Next Hop Address.

 

Firstly, I completely understand the more experienced of you will read this and suggest I obtain this using the REST API or perhaps even writing a Python script to obtain the data from JSON.

 

However, my comprehension of these methods is very limited due to my experience with ACI as a whole.

 

With that being said, I am currently left with firing off Moqueries on specific Classes and dumping the data into a text file.

 

So far I've had no issues with that - Here is what I am executing:

 

moquery -c ipRouteP,ipNexthopP -d 'uni/tn-TENANT_NAME'

 

And Sure enough this is showing me the exact data I need.

 

What I am also doing is using Grep to filter the results to show only what I need:

 

'^#\|^dn\|^ip\|^nhAddr'

 

However, this shows me all of the routes for all nodes and I haven't been able to find a way to specifically filter out the nodes to show only the ones I want.

 

If anyone has achieved this please do share, because I have spent some time researching Grep filtering & Moqueries and I have not yet found an answer to my query.

 

Thank you in advanced!

1 Accepted Solution

Accepted Solutions

Sergiu.Daniluk
VIP Alumni
VIP Alumni

Hi @AukeyPeach 

You can use filters with wildcards, Example to get all static routes for node-101:

moquery -c ipRouteP -f 'ip.RouteP.dn*"node-101"'

Stay safe,

Sergiu

 

View solution in original post

2 Replies 2

Sergiu.Daniluk
VIP Alumni
VIP Alumni

Hi @AukeyPeach 

You can use filters with wildcards, Example to get all static routes for node-101:

moquery -c ipRouteP -f 'ip.RouteP.dn*"node-101"'

Stay safe,

Sergiu

 

Perfect!
I was thinking about this the wrong way and instead should have used the filter function for Moquery instead of grep - Thanks a lot!
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Save 25% on Day-2 Operations Add-On License