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 | latency | size} trigger [{connection | logical connection | route | queue | rep agent | partition} [component_name]] [with primary primary_connection] for server_name {status changes to state | size {exceeds | falls below} size_threshold | latency {exceeds | falls below} latency_threshold} [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.
Identifies the primary connection for a connection latency trigger. The trigger executes the script if the latency threshold between the primary connection and the replicate connection is not satisfied.
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.
Indicates whether the trigger should execute when the size exceeds the threshold or when it falls below the threshold.
Indicates whether the trigger should execute when the latency exceeds the threshold or when it falls below the threshold.
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
Adds a trigger to the Replication Server INVENTORY_RS partition “p1” that executes the script email.sh when the partition usage exceeds 80 percent. The script is executed at every subsequent monitoring interval as long as the partition usage exceeds 80 percent:
add size trigger partition p1 for INVENTORY_RS size exceeds 80 continuous true execute /sybase/RMS/scripts/email.sh
Adds a trigger to the Replication Server INVENTORY_RS that executes the script email.sh when the sum of all partition usage exceeds 75 percent:
add size trigger partition for INVENTORY_RS size exceeds 75 execute /sybase/RMS/scripts/email.sh
Adds a trigger to the queue “inventory_pds.vendor(Inbound)” of Replication Server INVENTORY_RS that executes the script email.sh when the queue size falls below 100 megabytes. The script is executed at every subsequent monitoring interval as long as the queue size is less than 100 MB:
add size trigger queue inventory_pds.vendor(Inbound) for INVENTORY_RS size falls below 100 continuous true execute /sybase/RMS/scripts/email.sh
Adds a trigger to the replicate connection “inventory_rds.vendor” of replicate Replication Server INVENTORY_RS that will execute the script email.sh when the latency from the primary connection “inventory_pds.vendor” exceeds 5 minutes (300 seconds):
add latency trigger connection inventory_rds.vendor with primary inventory_pds.vendor for INVENTORY_RS latency exceeds 300 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.
You must set server_name to the name of the replicate Replication Server when adding a latency connection trigger. In the following example, INVENTORY_RS is the replicate Replication Server:
add latency trigger connection inventory_rds.vendor with primary invetory_pds.vendor for INVENTORY_RS latency exceeds 300 execute /sybase/RMS/scripts/email.sh
You must set the configuration parameter ltl_origin_time_require to “true” when setting up a latency connection trigger where the primary connection is from a Replication Agent or MRA. To set the parameter, connect to the Replication Agent or MRA and execute:
ra_config ltl_origin_time_required, true
add event trigger returns the following result set:
Column |
Description |
---|---|
Action |
The name of the action |
Result |
The result of the execution |