The sp_qstatmon script monitors the status of the capture and post queues for message backlogs. You can configure the script to alert you if the number of messages in a queue exceeds a defined threshold (limit), indicating that there is a potential data, system or network problem. This gives you time to correct the problem before the queues exceed their allocated space on the filesystem.
After each analysis of the queues, the sp_qstatmon script prints a notice in the capstat.log file for the capture queue or the poststat.log file for the post queue, as well as an e-mail message if that option is enabled.
Prepare to run sp_qstatmon
Before running the script, perform the following tasks.
See Requirements for using the monitoring scripts before using this script. Note: The script must be run in the ksh shell.
Assign permission to create temporary files
The script creates some temporary files in the util sub-directory of the SharePlex product directory. Assign write permission to that directory to the sp_qstatmon module.
Define email addresses
To execute sp_qstatmon with e-mail notification, you must first must define the e-mail address(es) in the script. Notification messages are sent to all addresses coded in the script. Unless email notification is enabled, sp_qstatmon only logs errors to the log file.
You can specify as many addresses as you want.
- Open the sp_qstatmon script in any ASCII text editor. The script is in the .app-modules directory in the SharePlex installation directory.
Add the address strings after the MailUserName= variable. Use the full e-mail and/or pager address. Separate multiple entries with a comma, as shown in the following example.
- Save and close the file.
Run the script from the util sub-directory of the SharePlex product directory, not from app-modules. When you run it from the util directory, you actually make a soft link that runs a utility which first sets up the correct environment before running the script itself.
nohup sp_qstatmon -v path -t n -p port_number [-c integer ] [-d integer ] [-m] > /dev/null &
Table 9: Required arguments
||Directs the script to continue running in the background if the user logs out. This ensures continuous monitoring. The sp_qstatmon component runs the script.|
||Sets the path to the SharePlex variable data directory for the instance of sp_cop that you want to monitor. Without this variable, sp_qstatmon fails and prints an error message requesting a valid path.|
||Sets the time interval between scans in seconds. This value can be any positive integer. |
||Sets the port number for the instance of sp_cop that you are monitoring. You can monitor different SharePlex instances by running sp_qstatmon for each one, using different values for this argument.|
||Runs the script in the background.|
Table 10: Optional arguments
||Redirects the notification output to the /dev/null device on the local system so that the monitoring process continues to run in the background and generate output. To have the output appear on screen, omit this argument.|
||Sets the number of messages in the capture queue at which the script issues a warning message. This value can be any positive integer. Without this parameter, sp_qstatmon defaults to 100 messages.|
||Sets the number of messages in the post queue at which the script issues a warning message. This value can be any positive integer. Without this parameter, sp_qstatmon defaults to 100 messages.|
||Enables the e-mail/paging option. Without this parameter, sp_qstatmon only logs errors to the log file.|
SharePlex provides the Sp_Nt_Mon script for monitoring processing Windows systems. Sp_Nt_Mon runs in the background to monitor SharePlex and notify you of events and conditions that can adversely affect replication. This script provides a monitoring mechanism without the need for frequent status checks through sp_ctrl.
Important! Do not rename this script.
The Sp_Nt_Mon script detects and reports the following conditions by email:
- The status of the Capture, Read, Export, Import, Post, and Sp_Copsrv.exe processes.
- The volume of the capture and post queues.
- Latency between transactions being processed by Oracle and by SharePlex.
- Specific messages in the Event Log (described later in this topic)
To configure and run Sp_Nt_Mon
- Run the SpClient utility from the SharePlex programs group.
- On the SpClient toolbar, click the SpMonitor button.
- Select the port number of the instance of SharePlex that you want to monitor, then click Configure Monitor.
Refer to the following table to modify the properties in the sp_nt_mon.txt file. Sp_Nt_Mon reads input from this file. To make comments in this file, start each comment line with the # symbol.
||Sets a time interval, in seconds, between monitoring polls.|
|Send Email alert
Enables or disables email alerts. Email is the only reporting option.
0 = disabled
1 = enabled
|SMTP Server Name
||Specifies the name of the SMTP server for the e-mail account.|
Specifies one or more email addresses that will receive monitor notifications. Separate each email address with a space, for example:
Email Address: Your.Name@YourCompany.com Other.Name@YourCompany.com
|0 (do not monitor)
Specifies processes to monitor. A value of 1 enables monitoring and must be set for each process that you want to monitor. For example, to monitor Capture and Export, set the properties as follows:
|0 (do not monitor)
Sets the maximum number of messages that a queue can contain before an alert message is triggered.
Set a positive numeric value for each queue that you want to monitor. Set a value that is well below the amount of disk space that is allocated to this queue. This gives you enough time to add disk space or resolve any problems that are causing a backlog.
|Monitor the Event Log
||0 (do not monitor)
Enables or disables the monitoring of supported Event Log messages.
0 = disabled
1 = enabled
The following messages are monitored:
SharePlex was shutdown
System call error
Queue partition is full
Host is down
Out of sync
Parameter was changed Activate config
Bad config file
sp_cop was shutdown
Child process failed
ORA-error number errors
|Monitor Redo Logs
||0 (do not monitor)
(Oracle only) Enables or disables the monitoring of Capture latency.
0 = disabled
1 = enabled
||(Oracle only) Sets a value for the maximum permissible number of logs for Oracle to be ahead of SharePlex in the redo stream. When the value is reached, an alert is triggered. Use when Monitor Redo Logs is enabled. |
- Click Start to run the script. The script starts and the word Start becomes Stop. The script runs continuously to monitor SharePlex until you click Stop.
SharePlex provides agent support for Simple Network Management Protocol (SNMP) on all Unix, Linux, and Windows platforms supported by SharePlex replication.
Note: SharePlex provides only agent support for SNMP. It only sends SNMP traps. SharePlex does not provide an SNMP signal daemon (SNMP manager) to intercept the traps. Use the SharePlex SNMP feature only if you have a Network Management Station (NMS) to manage SNMP signals. The SharePlex SNMP agent is named snmptrap and is installed with SharePlex in the bin sub-directory of the SharePlex product directory. Do not run this program.
To enable SNMP monitoring of SharePlex replication, set the SP_SLG_SNMP_ACTIVE parameter to 1. By default, the parameter is set to 0 (disabled).
Configure the SNMP agent
The following parameters configure the SNMP agent to communicate with the NMS. Each parameter must have a value if the SP_SLG_SNMP_ACTIVE parameter is enabled.
||The name of the system (host) to which the traps will be sent|
||The community security string|
||The major error number to be used by the traps|
||The minor error number to be used by the traps|
Custom MIB parameters
The following parameters specify required information for a custom MIB.
||The enterprise object identifier to send with the trap. The default is 220.127.116.11.18.104.22.168.1 .|
||A custom object identifier to bind to the trap. The default is 22.214.171.124.126.96.36.199.0.|
||The name of the trap program. The default is iwsnmptrap.|
Configure the SNMP traps
The following parameters configure the SNMP agent to send traps for specific replication events. The message or error text for the event is included in the trap and is the same error that appears in the Event Log.
To enable an SNMP trap for an event, set the corresponding parameter to a value of 1. By default all traps are disabled (parameter value of 0).
||SharePlex logic errors and errors that cause processes to exit|
||System-related errors encountered by SharePlex|
||Other SharePlex errors|
||Replication is out of synchronization|
||SharePlex starts up|
||SharePlex shuts down|
||A SharePlex process starts|
||A SharePlex process stops|
Prevent and solve replication problems