08-21-2024 10:16 PM - edited 08-21-2024 10:31 PM
I am trying to capture (either in APIC Dashboard or through a command) the down status of all leaf interfaces in APIC.
I believe it is possible through "moquery" command. Please advice.
Solved! Go to Solution.
08-22-2024 01:40 AM - edited 08-22-2024 01:58 AM
Do see all interfaces which are down you can use
moquery -c ethpmPhysIf -f 'ethpm.PhysIf.operSt!="up"' | grep dn | sort
Or all interfaces and their state in JSON:
moquery -c ethpmPhysIf -o json | jq '.imdata[] | {dn: .ethpmPhysIf.attributes.dn, operSt: .ethpmPhysIf.attributes.operSt}'
Or all states in a table kind of form
moquery -c ethpmPhysIf -o json | jq -r '.imdata[] | [.ethpmPhysIf.attributes.dn, .ethpmPhysIf.attributes.operSt] | @tsv' | sed 's/\t/ => /g'
Same for all up interfaces
moquery -c ethpmPhysIf -o json | jq -r '.imdata[] | [.ethpmPhysIf.attributes.dn, .ethpmPhysIf.attributes.operSt] | @tsv' | sed 's/\t/ => /g' | grep up
Same for all interfaces which are not up
moquery -c ethpmPhysIf -o json | jq -r '.imdata[] | [.ethpmPhysIf.attributes.dn, .ethpmPhysIf.attributes.operSt] | @tsv' | sed 's/\t/ => /g' | grep -v up
HTH
08-22-2024 01:40 AM - edited 08-22-2024 01:58 AM
Do see all interfaces which are down you can use
moquery -c ethpmPhysIf -f 'ethpm.PhysIf.operSt!="up"' | grep dn | sort
Or all interfaces and their state in JSON:
moquery -c ethpmPhysIf -o json | jq '.imdata[] | {dn: .ethpmPhysIf.attributes.dn, operSt: .ethpmPhysIf.attributes.operSt}'
Or all states in a table kind of form
moquery -c ethpmPhysIf -o json | jq -r '.imdata[] | [.ethpmPhysIf.attributes.dn, .ethpmPhysIf.attributes.operSt] | @tsv' | sed 's/\t/ => /g'
Same for all up interfaces
moquery -c ethpmPhysIf -o json | jq -r '.imdata[] | [.ethpmPhysIf.attributes.dn, .ethpmPhysIf.attributes.operSt] | @tsv' | sed 's/\t/ => /g' | grep up
Same for all interfaces which are not up
moquery -c ethpmPhysIf -o json | jq -r '.imdata[] | [.ethpmPhysIf.attributes.dn, .ethpmPhysIf.attributes.operSt] | @tsv' | sed 's/\t/ => /g' | grep -v up
HTH
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