Implementing typical menu items

The following examples illustrate how to implement some common menu items.

Displaying the KM version

The Display KM Version menu item provides the current version number of the PATROL KM. Get this information from the PATROL Agent namespace by using the following example:

version = get("/Application/version");
response("Version", -1, "h=500,w=500",
[R_LABEL, "Version: ".version]);

Note

Your PATROL KM must provide /Application/version as it is not provided by PATROL.

Displaying About Information from the Help menu

The Help > About menu item can provide information about your PATROL KM such product name, version number, and copyright information.

The following example uses the PSL response() function to display the About menu information:

response("About", -1, "h=500, w=500",
   [R_LABEL, "This is where the about text goes"]);

Refreshing the PATROL parameters

The Refresh Parameters menu item updates the values of all your parameters for a target object class.

This example uses the OS command type:

%REFRESH_PARAMS

The Refresh Parameters command can be handled through a single PSL function call and a PATROL built-in variable.

If the application class is not using a collector parameter

Use the following command:

refresh_parameters(("/".get("./appType")."/".
   get("./name"));

If the application class is using a collector parameter

Use the following command:

refresh_parameters("/".get("./appType")."/".
   get("./name")."/".paramname);

where param_name is the name of the collector for the application class. You must specify the path to the collector parameter, which may be in another PATROL KM. Use this command to refresh the consumers of that collector.

The command accesses two variables in the Agent namespace that are available at the application instance level:

  • appType is a PATROL application instance variable containing the application class name to which the instance belongs.
  • name is a PATROL application instance variable containing the instance name of the application instance.
Was this page helpful? Yes No Submitting... Thank you

Comments