We'll use the existing framework from one of the previous recipes as a basis, and modify it for our needs.
- 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).
- 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"];
- Modify the processXMLResponse() function ...