The RCM can execute a process when an event occurs, for example, when failover begins. This process is a script or a program that you create and then define in the RCM configuration file using the NOTIFICATION_PROCESS parameter.
When working with the RCM notification process, be aware that:
The notification process is executed from the RCM current working directory (the directory where the RCM executable is installed).
The notification process is executed with the same set of permissions used to execute the RCM.
Output is redirected to a temporary file. The full path name of this file is written to the RCM log and is prefixed with “rcm.”
The RCM does not delete the temporary output file.
The notification ID and text message are passed as parameters to the script program.
Table 4-5 lists the events that trigger the RCM notification process.
Notification ID |
Event description |
---|---|
1 |
The RCM has detected a possible failover situation where the active Adaptive Server is not responding. The RCM is about to enter a wait state to determine if the active Adaptive Server is down, or if it will automatically recover. |
2 |
The failover process has started. The RCM has determined that the active Adaptive Server is down and is failing over in the replication environment. |
3 |
The failover has been aborted, because the active Adaptive Server has recovered before the RCM started the failover process. |
4 |
The RCM cannot connect to Replication Server. The RCM switches the users to the standby Adaptive Server without failing over the logical connections in Replication Server. |
5 |
The RCM cannot start the Replication Agent in the standby Adaptive Server after switching the logical connections in Replication Server. |
6 |
Executing the failover process in Replication Server has failed. This occurs when the RCM unsuccessfully executes either the switch active or the quiesce commands. |
7 |
The RCM has finished the Replication Server failover process. The RCM is about to switch users to the standby Adaptive Server. |
8 |
Switching the users in OpenSwitch from the active Adaptive Server to the standby Adaptive Server has failed. The active Adaptive Server is locked, all existing connections are suspended, and new users cannot log in. |
9 |
The RCM failover process has completed. |
10 |
The RCM has exited, probably because the connection to the primary OpenSwitch is lost, or because of some internal error. |
11 |
The RCM has lost the connection to the OpenSwitch. The message identifies which OpenSwitch server failed. The RCM exits if the OpenSwitch server is not a secondary OpenSwitch server in a dual OpenSwitch environment.
|
12 |
A test notification is executed when the user starts the RCM with the -a (analyze) option. |
The RCM displays a notification ID and a text message in its log when any of the events in Table 4-5 occur. The text message is similar to the event description in the table. To determine what process you want performed when events occur, read the event description in Table 4-5.
Some examples of processes that can be triggered by events are:
Launching e-mail
Launching a pager program
Running a script that displays the notification ID and event description to console
For example, the following segment of the configuration file sets the NOTIFICATION_PROCESS parameter to execute a program called email.sh when an event occurs:
# Set notification process to email me NOTIFICATION_PROCESS = email.sh
To set up the notification process to trigger a program or script, you must set the NOTIFICATION_PROCESS parameter. If you do not include this parameter, the RCM does not send notification of events. See “Understanding RCM configuration parameters” for more information.
The RCM records all events in its log, so if you do not set the NOTIFICATION_PROCESS parameter but need to troubleshoot the failover, examine the RCM log, called rcm.log, in the RCM subdirectory.