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.
Satisfy requirements
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 using the following procedure:
- 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.
scott@company.com, 12345678910@pageservice.com
- Save and close the file.
Run sp_qstatmon
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.
Syntax:
nohup sp_qstatmon -v path -t n -p port_number [-c integer ] [-d integer ] [-m] > /dev/null &
Table 11: Required arguments
Argument | Description |
---|---|
nohup sp_qstatmon | 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. |
-v path | 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. |
-t n | Sets the time interval between scans in seconds. This value can be any positive integer. |
-p port | 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 12: Optional arguments
Argument | Description |
---|---|
/dev/null | 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. |
-c integer | 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. |
-d integer | 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. |
-m | Enables the e-mail/paging option. Without this parameter, sp_qstatmon only logs errors to the log file. |