06-28-2022 09:19 AM - edited 06-28-2022 09:21 AM
Hi all,
I need to audit our env and I need to complete a search and have it return all Tenants and EPG's that have lack a specific domain, this is so we can find out where we need to update them.
The moquery I'm running at the moment is:
moquery -c fvRsDomAtt -f 'fv.RsDomAtt.dn*"epg-EPG" and fv.RsDomAtt.tDn!="uni/phys-PHY-CORE"' | grep "^tDn\|^dn"
In plain english:
Search for all Domains where the associated distinguished name is appended with epg-EPG and does NOT have PHY-CORE as a domain - The Append is no longer necessary moving forward.
This is fine, and for the most part it got me 99% of the way.
However it's not quite what I need because I've checked a few EPG's that are not appended with "EPG" and some of them lack the PHY-CORE domain that I need them to have.
So what I'm trying to do now is search for all EPG's that do NOT have the PHY-CORE domain associated with them.
Problem is, the way the query seems to operate, it's returning essentially every single EPG, but removing the entries for the PHY-CORE - So for example an EPG might have 3 Domains - Domain-1, Domain-2 and PHY-CORE
Running the following will display those EPG's with PHY-CORE omitted - What I want to find are EPG's that do NOT have PHY-CORE domain at all.
moquery -c fvRsDomAtt -f fv.RsDomAtt.tDn!="uni/phys-PHY-CORE"'
I thought perhaps an XOR operator would do the trick but sadly it didn't return anything, so this isn't what I'm after I assume.
Thank you!
Solved! Go to Solution.
07-05-2022 02:08 AM
Happy you guys found a solution - however, just because I'm curious: Isn't my initial command reporting the same result? It's doing more or less the same as Sergiu's commands...? Or did I miss something?
07-05-2022 03:35 AM
Hehe, I just looked over your post, and indeed is pretty much the same logic (but with different class used to get the not-desired epgs), and all in a single command ^_^
07-05-2022 03:37 AM
07-04-2022 12:33 PM
My apologies, I mistakenly put the wrong class that I was querying and have cleared up - Just incase anyone searching google will find this at some point.
The correct class is fvRsDomAtt
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide