asnmon: Starting a Replication Alert Monitor
Use the asnmon command to start a Replication Alert Monitor on Linux®, UNIX, Windows, and UNIX System Services (USS) on z/OS®. Run this command at an operating system prompt or in a shell script.
Syntax
Parameters
Table 1 defines the invocation parameters for the asnmon command.
Parameter | Definition |
---|---|
monitor_server=serverh | Specifies the name of the Monitor control server where the Replication Alert Monitor program
runs and the monitor control tables reside. This must be the first parameter if entered. Linux, UNIX, Windows: If you do not specify a Monitor control server, this parameter defaults to the value from the DB2DBDFT environment variable. z/OS: The default is DSN. |
monitor_qual=mon_qual | Specifies the monitor qualifier that the
Replication Alert Monitor program uses. The monitor qualifier identifies
the server to be monitored and the associated monitoring conditions. You must specify a monitor qualifier. The monitor qualifier name is case sensitive and can be a maximum of 18 characters. |
monitor_interval=n | Specifies how frequently (in seconds) the
Replication Alert Monitor program runs for this monitor qualifier.
The default is 300 seconds (five minutes). This parameter is ignored by the Replication Alert Monitor if you set the runonce parameter to y. Important: This monitor_interval parameter
affects the Replication Alert Monitor program only. This parameter
does not affect Q Capture, Q Apply, Capture, and Apply programs.
|
runonce=y/n | Specifies whether the Replication Alert
Monitor program runs only one time for this monitor qualifier.
|
arm=identifier | z/OS: Specifies a three-character alphanumeric string that is used to identify a single instance of the Replication Alert Monitor program to the Automatic Restart Manager. The value that you supply is appended to the ARM element name that the monitor program generates for itself: ASNAMxxxxyyyy (where xxxx is the data-sharing group attach name, and yyyy is the Db2® member name). You can specify any length of string for the arm parameter, but the monitor program will concatenate only up to three characters to the current name. If necessary, the monitor program will pad the name with blanks to make a unique 16-byte name. |
autoprune=y/n | Specifies whether automatic pruning of the
rows in the Replication Alert Monitor alerts (IBMSNAP_ALERTS) table
is enabled.
|
logreuse=y/n | Specifies whether the Replication Alert
Monitor program reuses or appends messages to its diagnostic log file
( db2instance.monitor_server.mon_qual.MON.log ).
|
logstdout=y/n | Specifies where messages are sent by the
Replication Alert Monitor program.
|
term=y/n | Specifies whether a monitor program keeps
running when Db2 is quiesced.
|
alert_prune_limit=n | Specifies how long (in minutes) rows are kept in the Replication Alert Monitor alerts (IBMSNAP_ALERTS) table. Any rows older than this value are pruned. The default is 10 080 minutes (seven days). |
trace_limit=n | Specifies how long (in minutes) a row can remain in the Replication Alert Monitor trace (IBMSNAP_MONTRACE) table before it becomes eligible for pruning. All IBMSNAP_MONTRACE rows that are older than the value of this trace_limit parameter are pruned at the next pruning cycle. The default is 10 080 minutes (seven days). |
max_notifications_per_alert=n | Specifies the maximum number of the same alerts that are sent to a user when the alerts occurred during the time period specified by the max_notifications_minutes parameter value. Use this parameter to avoid re-sending the same alerts to a user. The default is 3. |
max_notifications_minutes=n | This parameter works with the max_notifications_per_alert parameter to indicate the time period when alert conditions occurred. The default is 60 minutes. |
pwdfile=filepath | Specifies the fully qualified name of the password file. You define this file by using the asnpwd command. The default file name is asnpwd.aut. |
monitor_path=path | Specifies the location of the log files used by the Replication Alert Monitor program. The default is the directory where the asnmon command was invoked. |
monitor_errors=address | Specifies the email address to which notifications
are sent if a fatal error is detected before the alert monitor connects
to the Monitor control server. Use this parameter to send a notification
that the Monitor control server connection failed because of invalid
start parameters, an incorrect monitor qualifier, a down database,
or other error. Type double quotation marks around the email address text. You can enter multiple email addresses. Separate the email addresses with commas. You can type spaces before or after the commas. |
email_server=server_name | Specifies the email server address. Enter this parameter only if you use the ASNMAIL exit routine with SMTP (Simple Mail Transfer Protocol). The monitor uses port 25 by default to connect to the email server. |
console=y/n | z/OS: Specifies whether the Replication Alert Monitor program sends
alert notifications to the z/OS console. If you set this
parameter to Y (yes) and an email server was already configured, alerts are sent to both the z/OS console and the email server.
|
confmt=y/n | z/OS: Specifies whether alert notifications that go to the z/OS console use a format that is standardized for system automation:
Note: Informational messages are not affected by this parameter and are always issued with the
regular asnmon log format.
|
monintmsg=y/n | Specifies whether the monitor program issues
an ASN5194I message at each monitor interval to indicate that it is
running and state the time range within which it monitors for alert
conditions:
|
sender_address | z/OS: Specifies a valid email address as sender email address. Some providers such as pager services require a full valid return address for filtering unsolicited messages and do not consider the default sender address that is used by the monitor program, asnmon@hostserver, as valid. If a valid return address is not provided, the alert emails might be blocked. |
alerts_tofile | Linux, UNIX, Windows: Specifies whether the monitor program writes
alerts to files.
|
alerts_totable | Linux, UNIX, Windows: Specifies whether the monitor program writes
alerts to the IBMSNAP_ALERTS table.
|
alerts_file_path | Linux, UNIX, Windows: The path where alert files are generated. The default is the directory from which the asnmon command was issued. |
alerts_filesz | Linux, UNIX, Windows: The maximum file size in megabytes for an alert file. When this size is exceeded the monitor generates a new alert file. Default: 1 MB |
Return codes
The asnmon command returns a zero return code upon successful completion. A nonzero return code is returned if the command is unsuccessful.
Examples for asnmon
The following examples illustrate how to use the asnmon command.
Example 1
To start the Replication Alert Monitor with the default parameters:
asnmon monitor_server=wsdb monitor_qual=monqual
Example 2
To start a Replication Alert Monitor that runs every 120 seconds (two minutes) for the specified monitor qualifier:
asnmon monitor_server=wsdb monitor_qual=monqual monitor_interval=120
Example 3
To start a Replication Alert Monitor and specify that it run only once for the specified monitor qualifier:
asnmon monitor_server=wsdb monitor_qual=monqual runonce=y
Example 4
To start a Replication Alert Monitor that sends email notifications if it detects monitoring errors:
asnmon monitor_server=wsdb monitor_qual=monqual
monitor_errors="repladm@company.com, dbadmin@company.com"
Example 5
To start a Replication Alert Monitor that runs every 120 seconds (two minutes) and waits 1440 minutes (24 hours) before sending alerts:
asnmon monitor_server=wsdb monitor_qual=monqual monitor_interval=120
max_notifications_per_alert=2 max_notifications_minutes=1440
This Replication Alert Monitor program sends a maximum of two alerts when the alerts occurred during the time period specified by the max_notifications_minutes parameter value (1440 minutes).