Skip to main content
Question

Nqe query for BGP Admin status id down

  • September 3, 2024
  • 3 replies
  • 48 views
  • Translate

Forum|alt.badge.img
  • Spotter
  • 9 replies

Hi All,

 

Can you please help me to write a NQE query for all ip details where BGP Admin status  id is showing down.

3 replies

RobertWelch
Employee
Forum|alt.badge.img
  • Employee
  • 14 replies
  • September 3, 2024

Something like this with a filter?
 

/**
 * @intent Find all devices where BGP peering is enabled and session is not established state
 */


foreach device in network.devices
foreach networkInstance in device.networkInstances
foreach protocol in networkInstance.protocols
where isPresent(protocol.bgp)
let bgp = protocol.bgp
foreach neighbor in bgp.neighbors
where isPresent(neighbor.sessionState)
where neighbor.enabled
where neighbor.sessionState != BgpSessionState.ESTABLISHED
select {
  deviceName: device.name,
  networkInstanceName: networkInstance.name,
  protocolIdentifier: protocol.identifier,
  neighborNeighborAddress: neighbor.neighborAddress,
  sessionState: neighbor.sessionState,
  enabled: neighbor.enabled
}

 

Translate

Forum|alt.badge.img
  • Author
  • Spotter
  • 9 replies
  • September 5, 2024

@RobertWelch ,

 

Can you please confirm the above query is able to pull the bgp admin status ?

Translate

RobertWelch
Employee
Forum|alt.badge.img
  • Employee
  • 14 replies
  • September 5, 2024

@Nand - Has the Source / Device been modeled?  NQEs run against the data gathered (configuration, state and normalized data such as BGP).  NQEs do not issue commands directly to the end devices.  Thus, if the Source / Device has been modeled, you can create BGQ NQEs such as this as well as use many of the Predefined BGP NQEs and those in the NQE Library.  For example, in the Predefined, there is a report for BGP peer status and triggers a pass / fail that you can then be notified upon. 

BGPs is one of the wonderful normalized states whereby one does not have to parse the syntax for the various platforms.  

Translate

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings