Hi All,
Can you please help me to write a NQE query for all ip details where BGP Admin status id is showing down.
Hi All,
Can you please help me to write a NQE query for all ip details where BGP Admin status id is showing down.
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
}
Can you please confirm the above query is able to pull the bgp admin status ?
BGPs is one of the wonderful normalized states whereby one does not have to parse the syntax for the various platforms.
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.