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

Server application

The server application follows the same principles learned in the previous recipes. It instantiates a JUNOSDevice Javascript object for each of the declared JUNOS OS devices in the configuration file, making use of ssh2 to manage the SSH session, and using xml2js in order to maintain a flowing XML dialog with each element simultaneously.

After exchanging pleasant XML greetings, the server eventually issues the <get-ldp-traffic-statistics-information> RPC to the JUNOS device and when the response comes back, the new code introduced in this recipe fires. It proceeds to extract the following data from the XML RPC response:

Element
Description
ldp-prefix The IP-layer prefix, or forwarding equivalence class, represented ...

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