O'Reilly logo

JUNOS Automation Cookbook by Adam Chappell

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How it works...

The interesting activities start in step 2 where we make the actual call to JUNOS's mgd software daemon in order to query the operational BGP state. mgd in turn queries rpd, formats the output nicely as XML, and returns it to us.

In step 3, we inspect the returned BGP structure and focus on several properties of it, as shown in the table:

XPath Reference

Description

peer-state

A textual description of the BGP peer's current state

peer-id

Numeric identifier of the peer, usually IP address

peer-address

IP address of the BGP peer

peer-as

The autonomous system number of the BGP peer

input-messages

The number of received BGP messages

output-messages

The number of transmitted BGP messages ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required