CGI script parameters

When you write a CGI script for use in an extended context menu, you must use the script parameters to reference the device from which the script is called.

To reference the device, use the following fixed parameters, which are automatically passed to user-defined scripts by TopoViz.

Attention: The parameters are provided only when no parameters are specified in the URL tool definition. Otherwise, the parameters passed to the CGI script are as specified in the tool.
$selected_rows.ServerName
This value defines the name of the ObjectServer that corresponds to the current Network Manager domain. This value is defined in the ncp.domains table when the topology database is created.
$selected_rows.NmosObjInst
This value is a unique identifier for the device. It is equivalent to the ObjectId field in the mainNodeDetails table of the topology database.
$selected_rows.Node
This value is from the ObjectServer. The value is usually equivalent to the IpAddress field in the mainNodeDetails table of the topology database.

These values refer to the device that was selected when the context menu was used. Topoviz uses an HTTP Get request to call the script and passes the above parameters in the URL. The URL is encoded into x-www-form-urlencoded format. Non-alphanumeric characters are converted into the 3-character string %xy, where xy is the two digit hexadecimal representation of the lower 8-bits of the character.

Example

If a script named traceroute.cgi is run on the host 192.168.21.35, and the script is passed the following variables:

  • ServerName=Primary_01
  • NmosObjInst=1477
  • Node=192.168.0.7

A new browser window is opened with the following URL:

https://192.168.21.35:16316/ibm/console/webtop/cgi-bin/traceroute.cgi?%24selected_rows.ServerName%3DPrimary_01%26%24selected_rows.NmosObjInst%3D1477%26%24selected_rows.Node%3D192.168.0.7