cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
199
Views
1
Helpful
1
Replies

How to check the Down Status of All Leaf Interfaces in APIC

AshSe
Level 1
Level 1

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. 

1 Accepted Solution

Accepted Solutions

Marcel Zehnder
Spotlight
Spotlight

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


 

View solution in original post

1 Reply 1

Marcel Zehnder
Spotlight
Spotlight

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


 

Review Cisco Networking for a $25 gift card

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