Creating a Qapp to Retrieve Customized Device Property Value

This section introduces how to use a Qapp to assign values to the properties of a device in the Detail Details pane. A new Qapp will be created to populate the Serial Number properties.

1.Click the icon from the taskbar and select New Qapp from the drop-down menu to open the Qapp Editor.

2.At the Start node, leave the Define Qapp Device Input option as it is and click the icon to extend a Canvas node.

3.Double-click the Canvas node, keep the default settings for the Device Queue node.

4.In the Device Queue node, keep the default settings.

5.Extend a Device (this) node from the Device Queue node, and keep the default options.

6.Extend a CLI node from the this node.

7.At the Command1 node, enter the show version command in the Command field, and select show version (Cisco IOS Switch,Cisco Router) from the drop-down menu.

8.Extend a Table node from the Command1 node, click the icon, select the variable serial_num and click Attribute>> to add it to the Table1 node.

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 or table attributes by clicking either Table>> or 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>>.

9.Extend a Basic Output node from the Table1 node. At the Output node, you can set conditions to trigger the defined output. You can also use the default condition "True", which means "if the serial number exists".

10. Extend a Device Property action node from the Output node.

11. Define the Device Property1 node as follows:

1)Keep the default $_device option in the Device field.

2)Click Add in the Device Property pane. The application property is displayed by default. Point to the application cell and select sn from the drop-down list (sn means the serial number).

3)Point to the cell under the Variable header and select $serial_num from the drop-down list.

12. Save and run the Qapp on a map with Cisco IOS switches included. Once the Qapp execution is finished, double-click a device to view whether the Serial Number field is populated in the Device Details pane.


See also:

Specifying Property Value in Device Details Pane