Defining Command and Parser

The Command node in a canvas is used to specify a parser to retrieve specific data and parse the retrieved data. It follows after the this node and the device passed from the this node will execute the command defined here.

1.Extend a CLI node by pointing to the this node, clicking the icon, selecting CLI and then clicking Extend.

Note: The command has several types and each type has its own feature. See Command Types for more details.

2.Enter show process cpu in the Command field and select show process cpu (Cisco IOS Switch, Cisco Router) from the drop-down list. The variables related to this command are auto-loaded in the Variable Tree pane. You can alternatively click Select Parser and select a parser from the Parser Library directly.

Tip: The content in brackets refers to the device types that the parser applies to.

3.Click the icon on the CLI command node, select Device Data Table and click Extend. A Table node is added and it is used to store the parsed data passed from the CLI Command node. For a Device Data Table, it only contains data for one device in the current loop and can only be referenced in the current canvas.

4.Click the icon to export the variables defined in the CLI node to the Table node.
All the variables defined in the parser are listed in the left pane. In this case, hold the CTRL key and click the five_sec_cpu_usage and one_min_cpu_usage to select them, and then click Attribute >> to add them.

Note: When adding interface-level variables, you also need to add the key variable ($intf). This key variable will be used as the key to match an interface- level variable with the interface that the variable belongs to at Qapp execution.

Tip:  NetBrain parsers show the parsed data in two forms: Single Value and Table. For variables in the Single Value form, you can export them to a Table node as row data by clicking Table>> or as table attributes by clicking Attribute>>. However, for variables (mostly interface-level variables) in the Table form, you can only add them to a Table node as row data by clicking Table>>.