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

We'll use the existing framework from one of the previous recipes as a basis, and modify it for our needs.

  1. Take the collector.js source code from the system health monitoring recipe. (Ensure it has the modification so that it can poll multiple XML RPCs).
  2. Add in the <get-ldp-traffic-statistics-information> RPC to the list of XML RPCs at the top of the file. (There's no need to keep any of the other RPCs unless you intend to use the collector with the other associated web clients):
const xmlrpc = ["<rpc><get-interface-information><media/></get-interface-information></rpc>\n","<rpc><get-route-engine-information/></rpc>\n","<rpc><get-ldp-traffic-statistics-information/></rpc>\n"];
  1. Modify the processXMLResponse() function ...

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