The Generic-Telnet-Driver saves the command output to a text file. A simple and easy way to read a text file is using a GA_Driver.

In particular, by setting the ReadsInputFrom attribute of a GA_Driver as a GA_FileFE object whose fileName attribute is the input file name, the GA_Driver will automatically read the file line by line as input after the driver is started.

driver->ReadsInputFrom =  create(“GA_FileFE”, 
driver->ReadsInputFrom->fileName = outputFile;

The ASL script used to read the CLI output is ReadCLIOutput.asl, which is located in the BASEDIR/smarts/rules/mpls-t directory in the MPLS Management Suite installation area.

For a source Cisco device, here is an example of CLI command output as written to the output text file:

dev-VPLS5#terminal length 0
dev-VPLS5#terminal width 512
dev-VPLS5#ping mpls ipv4 repeat 5 timeout 2 size 100 interval 0
Sending 5, 100-byte MPLS Echos to, 
     timeout is 2 seconds, send interval is 0 msec:
Codes: '!' - success, 'Q' - request not sent, '.' - timeout,
  'L' - labeled output interface, 'B' - unlabeled output interface, 
  'D' - DS Map mismatch, 'F' - no FEC mapping, 'f' - FEC mismatch,
  'M' - malformed request, 'm' - unsupported tlvs, 'N' - no label entry, 
  'P' - no rx intf label prot, 'p' - premature termination of LSP, 
  'R' - transit router, 'I' - unknown upstream index,
  'X' - unknown return code, 'x' - return code 0
Type escape sequence to stop.
Success rate is 0 percent (0/5)

For a source Juniper device, here is an example of CLI command output as written to the output text file:

set cli screen-length 0 
Screen length set to 0
juniper@dev-MPLSp8> set cli screen-width 512
Screen width set to 512
juniper@dev-MPLSp8> ping mpls ldp count 5
--- lsping statistics ---
5 packets transmitted, 5 packets received, 0% packet loss

The output is carried with the variable “Output” from ReadCLIOutput.asl to pinglsp-ondemand.asl, which can also be obtained from the GA_Parameters object.

This output is passed with the variable “CLIOutput” from pinglsp-ondemand.asl to LSPPing.asl. The output is displayed on the Global Console using the print operation: