Adds a trigger that is executed by the RMS when a specific event occurs in the replication domain. A trigger identifies a process or script that is executed by the RMS.
add status trigger [{connection | logical connection | route | queue | rep agent |partition} component_name] for server_name status changes to state [wait wait_interval] [continuous continuous_flag] execute command
Type of trigger.
Specifies the type of component to be monitored. Components are monitored objects within a server. Replication Server components are connections, logical connections, routes, queues, and partitions; Adaptive Server Enterprise components are RepAgent threads.
Specifies the name of the component to be monitored.
Specifies the name of the server to be monitored. If the command is to add a trigger for a component, then the server is the owner of the component.
Specifies the state of the server or component to monitor. If state changes to the specified value, the trigger executes. The state value is dependent on the object type. See Appendix C, “RMS Server and Component States” for information about the state codes.
Specifies the number of seconds to wait before triggering the event. This allows the object time to recover. If you do not include the wait option, the event triggers immediately.
A Boolean flag that, if set to true, causes the RMS to execute the trigger’s script at every subsequent monitoring interval until the state changes. If you do not set this flag, the RMS executes the trigger script only once.
Specifies the command to be executed when the event is triggered. The command is operating-system-specific.
Adds a trigger that executes the script email.sh when the status of the server named INVENTORY_RS is changed to “DOWN”:
add status trigger for INVENTORY_RS status changes to DOWN execute /sybase/RMS/scripts/email.sh
Adds a trigger that executes the script email.sh after 120 seconds. Since the status of the connection “inventory_pds.pdb1” of server INVENTORY_RS is changed to “Suspended”, it will execute script at every subsequent monitoring interval until the state changes:
add status trigger connection inventory_pds.pdb1 for INVENTORY_RS status changes to Suspended wait 120 continuous true execute /sybase/RMS/scripts/email.sh
You can add one status trigger for each server or component status. For example, you can add a trigger for a Replication Server when the status changes to “DOWN” or “SUSPECT”, but you cannot add two triggers to the “DOWN” status.
add event trigger returns the following result set:
Column |
Description |
---|---|
Action |
The name of the action |
Result |
The result of the execution |