Basic Extensions (PSL only)

This section is targeted at PATROL KM developers, with a good knowledge of the PATROL Scripting Language (PSL) and how a KM runs on a PATROL Agent.

As an experienced PSL developer, you can specify how your KM will appear and behave in Monitoring Studio X. You can for example configure the icons to be used for the KM instances, customize the links to the online help, modify the behavior of the action buttons, etc. To achieve these basic customizations, you will use PSL scripts that will set specific namespace variables in the PATROL Agent.

Customizing Icons

To better identify your KM classes in the Monitoring Studio X Console, you can use a specific FontAwesome or Glyphicon icon for each class. To achieve this, you need to set the /<class>/X_icon namespace variable for each application class and the CSS class to apply in the prediscovery or the discovery PSL script of your KM.

Example of PSL script:

set("/SW_MAIN/X_icon", "fas fa-toolbox");
set("/SW_DBQUERIES/X_icon", "fas fa-database");

If you wish the online help of your KM classes to be accessible from the Monitoring Studio X Console, you can set the /<class>/X_help namespace variable and specify a link to a Web page served by the PATROL Agent or an external link on the Web.

You typically set the X_help variable for all your classes in the prediscovery or the discovery PSL script of your KM.

Example of PSL script:

# Specify the online help link for the SW_MAIN class (local link)
set("/SW_MAIN/X_help", "/swsy/help/");

# Specify the online help for the SW_DBQUERIES class (Internet link)
set("/SW_DBQUERIES/X_help", "https://www.sentrysoftware.com/library/swsyx/X_DBQUERY.html");

Modifying the Behavior of the COLLECT NOW Button

A COLLECT NOW button is available in the Monitoring Studio X Console for each PATROL object instance. This button triggers an actual collect on the agent for the selected instance. If no collector is available for the selected instance, the action takes place on its parent, and so on until at least one collector is found for a parent.

You can override this default behavior and specify which parameters or collectors needs to be executed when the user clicks the COLLECT NOW button. This is achieved by setting the X_refreshParameters namespace variable, either on a class or on an instance of a class.

Possible values of X_refreshParameters:

  • [<list of paths to collectors>, ...], to specify a list of collectors to be executed when the user clicks [COLLECT NOW]
  • "", empty string to use the default behavior
  • 0, to disable the COLLECT NOW button if it is not applicable to this instance or class.

The X_refreshParameters namespace variable can be set at any stage of the KM lifecycle (prediscovery, discovery, collector script, recovery action script). You can change the behavior of the COLLECT NOW button dynamically, depending on the current state of the monitored instance. The Web interface will adapt the COLLECT NOW button based on the value of X_refreshParameters at the moment the page is displayed to the user. You can for example choose to disable the COLLECT NOW button when the object instance is OFFLINE.

Example of PSL script:

# Triggers the execution of the proColl collector of the /SW_SENTRY/SENTRY8 instance
# when the user clicks on [COLLECT NOW] for any instance of the SW_PROCESSES class
set("/SW_PROCESSES/X_refreshParameters", ["/SW_SENTRY/SENTRY8/proColl"]);

# Disables the [COLLECT NOW] button on the main class
set("/SW_SENTRY/X_refreshParameters", 0);

# Specify the collector for one instance
set("/SW_STRINGS/error/X_refreshParameters", ["/SW_FILES/myLog/fileColl"]);
No results.