Define Sentinel commands for Web Dashboard
||If intended to be employed in Sentinel Monitoring, it is recommended to define the Commands within Composer.
The following information assumes that Sentinel Commands are used in Web Dashboard only. In this case, it is possible to have a minimalist XML definition that can be easily created manually.
Important Command objects defined this way will not be available in Sentinel Monitoring.
The following is a sample XML definition of a Sentinel Command:
This sample defines a Sentinel Command that displays in the Web Dashboard GUI under the name Dump traces. Upon execution, it triggers the execution of the my_command.bat file, and transmits the values of two fields: CycleId and EventId. Sentinel looks for the my_command.bat locally.
Transmitting contextual information to scripts (.bat, .sh, .exe, etc.) is configured in the command definition XML as follows. In Java classes, all fields available in the data dictionary, calculated fields and the context parameters, are automatically passed to the command without configuring these in the command definition XML. Passing user input to Java classes must be configured in the same way as in case of scripts.
You can transmit the value of any column available in the data dictionary, including the values of calculated fields. The following example displays how to configure the transmission of the fields PositionNumber and EVENTID, assuming they exist in the data dictionary.
|| For efficiency reasons, database tables exposed through standard dictionaries must have a primary key or at least a column named EVENTID that uniquely identifies every row in your search results. If none of these conditions are fulfilled, only displayed fields will be transmitted to the command. For SQL dictionaries there is no constraint.
By referring nonexistent fields in the command definition, Web Dashboard prompts the user for input. In the following example, Web Dashboard prompts the user for input for the parameter voucher:
Starting with Service Pack 2, the set of characters allowed by the user input can be configured by setting the property webdashboard.command.regex=<your regular expression> in server.properties file. The value of the property should be a valid regular expression.
Example: When allowing a 5 character long user input comprised of 1 small caps alphanumeric character, 1 numeric character, 1 underscore, 1 space, 1 large caps alphanumeric character ordered in this exact sequence, the property should be as follows:
Notice, the backslash (\) must be doubled, similar to any property that is using this character (like paths).
If the regular expression is not valid or the property is not set, the default regex is used, which is allowing only alphanumeric characters.
Username and PassPort domain (if it is the case) are transmitted to commands by using the syntax in the following example:
Remote execution on Sentinel Event Router
To configure a Command so its execution is forwarded to a Sentinel Event Router the <target> tag must be completed properly, as shown in the following example:
Correspondingly, Event Router must be properly configured to match the authorization details from the Command definition, as shown in the following matching target.xml for Event Router example:
For Sentinel to correctly identify the Event Router host and port, the fields AgentIpAddr and AgentIpPort must be available in your search as dictionary fields or as calculated fields.