Skip to content

Instantly share code, notes, and snippets.

@sulrich
Created February 14, 2024 19:32
Show Gist options
  • Save sulrich/2853482af68439aaf4b376c1ab980b67 to your computer and use it in GitHub Desktop.
Save sulrich/2853482af68439aaf4b376c1ab980b67 to your computer and use it in GitHub Desktop.

all peers up - dumb, fat, happy.

gnmic --insecure -u admin -p -a 172.20.20.61:6030 --format flat \
get --path /network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/.../state/enabled
network-instances/network-instance[name=default]/protocols/protocol[identifier=BGP][name=BGP]/bgp/neighbors/neighbor[neighbor-address=10.10.0.1]/afi-safis/afi-safi[afi-safi-name=IPV4_UNICAST]/state/enabled: true
network-instances/network-instance[name=default]/protocols/protocol[identifier=BGP][name=BGP]/bgp/neighbors/neighbor[neighbor-address=10.10.1.1]/afi-safis/afi-safi[afi-safi-name=IPV4_UNICAST]/state/enabled: true
network-instances/network-instance[name=default]/protocols/protocol[identifier=BGP][name=BGP]/bgp/neighbors/neighbor[neighbor-address=2001:db8:10:10:1::1]/afi-safis/afi-safi[afi-safi-name=IPV6_UNICAST]/state/enabled: true
network-instances/network-instance[name=default]/protocols/protocol[name=BGP][identifier=BGP]/bgp/neighbors/neighbor[neighbor-address=2001:db8:10:10::1]/afi-safis/afi-safi[afi-safi-name=IPV6_UNICAST]/state/enabled: true

neighbor down

router bgp 65001
   neighbor 10.10.0.0 shutd
 gnmic --insecure -u admin -p -a 172.20.20.61:6030 --format flat \
get --path /network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/.../state/enabled
network-instances/network-instance[name=default]/protocols/protocol[identifier=BGP][name=BGP]/bgp/neighbors/neighbor[neighbor-address=10.10.0.0]/state/enabled: false      #<< see me now!
network-instances/network-instance[name=default]/protocols/protocol[identifier=BGP][name=BGP]/bgp/neighbors/neighbor[neighbor-address=10.10.0.1]/afi-safis/afi-safi[afi-safi-name=IPV4_UNICAST]/state/enabled: true
network-instances/network-instance[name=default]/protocols/protocol[identifier=BGP][name=BGP]/bgp/neighbors/neighbor[neighbor-address=10.10.1.1]/afi-safis/afi-safi[afi-safi-name=IPV4_UNICAST]/state/enabled: true
network-instances/network-instance[name=default]/protocols/protocol[identifier=BGP][name=BGP]/bgp/neighbors/neighbor[neighbor-address=2001:db8:10:10:1::1]/afi-safis/afi-safi[afi-safi-name=IPV6_UNICAST]/state/enabled: true
network-instances/network-instance[name=default]/protocols/protocol[identifier=BGP][name=BGP]/bgp/neighbors/neighbor[neighbor-address=2001:db8:10:10::1]/afi-safis/afi-safi[afi-safi-name=IPV6_UNICAST]/state/enabled: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment