This topic provides information about how PATROL menus. A PATROL menu allows you to perform routine functions such as: to start or stop a database or to manage and monitor your application. In the object-oriented PATROL environment, PATROL KM menu items represent methods that act upon your PATROL application instances. The following topics are discussed here:
Each pop-up menu for a PATROL object contains a number of standard commands that perform a function or retrieve data. As a PATROL developer, you can build PATROL KM menu items, including cascading sub-menus, for each PATROL object (locally) or for your entire environment (globally), with commands that apply to your specific needs.
Menu commands can be any of the following:
A PATROL KM menu item executes on the PATROL Agent and not on the PATROL Console. When the user choose a menu item, the PATROL Console sends that menu item's corresponding script to the PATROL Agent and the PATROL Agent executes it.
All menu items run within the context of a PATROL instance. For example, a menu script selected from the /FILESYSTEM/root instance runs within the context of that instance on the PATROL Agent. This is most important when PSL scripts interact with the PATROL Agent namespace.
For example, get("name");
is equivalent to get("/FILESYSTEM/root/name");
when it is executed on the root filesystem.
When you create a menu item for an application class, the new menu item appears in the pull-down menu for each instance of that application class. When you pull the menu down and click the menu item, the PATROL Agent performs the following actions:
Create menus in the PATROL KM for the following:
Menu items can be either commands or tasks.
Use a command when the menu item consists of commands that apply either to all computer instances or to all computer instances for a particular OS type. Unlike tasks, the command cannot be stopped or restarted before it has completed.
Use a task when the menu item consists of the following:
A task is similar to a command except that it runs in background mode and is represented by an icon that can be controlled using a pop-up menu. By contrast, tasks produce a task icon (that appears as a checkered flag) and you can see their results in the task window.
The following table discusses menu items built for the following PATROL objects.
PATROL object menu types
PATROL object | Usage | Location |
---|---|---|
One computer instance |
| Computer instance shortcut menu |
One application instance |
| Application instance shortcut menu |
More than one computer or application instance of a class | These menu items are part of the PATROL computer KM to which the computer instances belong. | PATROL Console menu bar's Commands sub-menu |
Sometimes it is appropriate to restrict access by PATROL Operator Console users to certain KM menu items, such as KM administrative functions and system configuration options. PATROL does not provide the ability to selectively remove or inactivate a menu item. So you must code the command script for a restricted menu item to test for the PATROL Console type and terminate without execution if the requesting user is a PATROL Operator Console user.
You can test PATROL Console type using the PSL con sole_type() function. The following example shows one technique for limiting menu item execution:
if(console_type() != 1){ response("Error", -1, "h=500, w=500", [R_LABEL, "Only a Developer Console can use this"]); exit; }
For more information on the PSL response() function, see the PATROL Script Language Reference Manual.