Configuring Actions for SRC VTA Event Handlers (SRC CLI)
Use the following statement to configure an action that can be invoked by one or more event handlers:
We recommend that when you configure event handlers and their actions, you ensure that for any given event, all database operations are performed before any other operations that have permanent effects. This is because if a database error occurs—for example, due to normal contention for database records between different event threads—the SRC VTA rolls back the current database transaction (no changes are made to the database) and then restarts processing the event. If the event performs some other operation other than database operations before such an error, such as start a service, then that other operation is performed again when the event is reprocessed following the error.
From configuration mode, access the statement that configures an action and specify a name for the action. For example, to configure an action called act1 in the SRC VTA group called vta1:
You must not specify the action name as all, because the show vta statistics performance group name action command uses the all option to display event statistics of all actions.user@host# edit shared vta group vta1 action atc1
Specify a function you want the action to call. For example, to have the action call the db-engine-calculate-usage function:[edit shared vta group vta1 action atc1]user@host# set function db-engine-calculate-usage
(Optional) Specify any input parameters required for the function.[edit shared vta group vta1 action atc1]user@host# set parameter
The parameters that you need to set depend on what function you specified. Some functions require no input parameters. You can use the “?” completer to see what parameters need to be set, or see Configuring Actions Overview for a complete list of functions and their associated input parameters.
Specify what you want the action to do in response to an error. For example, to configure the action to terminate processing if an error occurs:[edit shared vta group vta1 action atc1]user@host# set on-error abort-event-processing
Verify your configuration.[edit shared vta group vta1 action atc1]user@host# show
user@host# show function db-engine-calculate-usage; on-error abort-event-processing; [edit shared vta group vta1 action act1] user@host#
Commit your configuration.[edit shared vta group vta1 action atc1]user@host# commit