Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
JUNOS Automation Cookbook

You're reading from   JUNOS Automation Cookbook Automate network devices on Juniper's operating system

Arrow left icon
Product type Paperback
Published in Sep 2017
Publisher Packt
ISBN-13 9781788290999
Length 382 pages
Edition 1st Edition
Tools
Concepts
Arrow right icon
Author (1):
Arrow left icon
 Chappell Chappell
Author Profile Icon Chappell
Chappell
Arrow right icon
View More author details
Toc

Table of Contents (16) Chapters Close

Title Page
Credits
About the Author
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface
1. Configuring JUNOS through NETCONF 2. Working with the Junos REST API FREE CHAPTER 3. Using SLAX to Write Op Scripts 4. Event Programming 5. Automating JUNOS with PyEZ 6. Advanced Visualization Applications 7. Monitoring and Maintaining JUNOS 8. Security Applications 9. Extending JUNOS with Ansible

Making custom show commands


In this recipe, we'll create a new SLAX op script, show-bgp.slax, in order to create a slightly more readable and visible show bgp summary command. We'll do this by executing the normal RPC associated with the show bgp neighbor command, extracting the pertinent information, tabulating, and formatting it for output.

Getting ready

In order to complete this recipe, you'll need access to a JUNOS router running Border Gateway Protocol (BGP) with a number of peers.

How to do it...

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:

  1. 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:...
lock icon The rest of the chapter is locked
Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
JUNOS Automation Cookbook
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime
Visually different images
Modal Close icon
Modal Close icon