We're going to create a SLAX script to call the necessary RPC to get the BGP information, then iterate through the returned structure, printing only a small but hopefully relevant subset of the information. The steps for the recipe are as follows:
- Start with the mandatory SLAX boilerplate as recommended by Juniper. This typically defines version numbers for compatibility and declares namespaces.
version 1.0; ns junos = "http://xml.juniper.net/junos/*/junos"; ns xnm = "http://xml.juniper.net/xnm/1.1/xnm"; ns jcs = "http://xml.juniper.net/junos/commit-scripts/1.0"; import "../import/junos.xsl";
- Make the RPC call in order to query the operational state of the BGP protocol within the JUNOS routing protocol daemon:
var $rpc ...