The Monitor utility is a MessageQ application that allows you to monitor and control the performance of your MessageQ for UNIX system.

This chapter describes how the Monitor utility lets you manage MessageQ functions such as:

Connecting to the MessageQ Environment

Starting and Stopping Queues

Starting and Stopping Cross-Group Connections

Managing Message Recovery Services

Note: For information about other MessageQ Monitor utility functions such as enabling, disabling, and resetting statistics collection, or viewing cumulative counts of the messages sent and received for all links and queues of a selected group, see Chapter 5, "Monitoring MessageQ".

Using the Monitor utility requires that you be connected to a bus and group. If you set the DMQ_BUS_ID and DMQ_GROUP_ID environment variables prior to invoking the Monitor utility, you will connect to that bus and a group when you invoke the Monitor utility. If you do not set the environment variables before invoking the Monitor utility, you must connect to the bus and group using the Monitor utility. The Monitor utility provides a character-cell and Motif user interface.

If your monitor does not have graphics capabilities, you can invoke the character-cell user interface. To invoke the character-cell user interface without attaching to a bus or group, enter the following command:

# dmqmonc

To invoke the character-cell user interface and specify the bus and group, use the following command format:

# dmqmonc -b bus_id -g group_id

Where:

-bbus_id

bus number

-ggroup_id

group number

The bus and group you specified appear at the bottom of the main window. If you did not specify a bus and group, the bus and group listed will be specified by the environment variables DMQ_BUS_ID and DMQ_GROUP_ID.

To monitor or control your MessageQ groups or buses, enter the letter or number associated with the activity you want to perform. In most cases, a secondary screen appears allowing you to monitor or control the performance of your messaging system. To return to the main menu from any secondary screen, press Return.

To use the Motif user interface, you must have a graphics monitor or workstation, and you must set the UIDPATH environment variable. Enter the following command to set this variable:

# setenv UIDPATH /usr/lib/X11/uid/%U:/install_dir/bin/%U

You must also set the NLSPATH environment variable, which allows MessageQ to properly translate error codes into text strings. To set the NLSPATH variable, enter the following command:

% setenv NLSPATH /usr/lib/nls/msg/%N:/install_dir/lib/nls/msg/%N

To invoke the Motif user interface, enter the following command:

# dmqmonm

Use the File menu item to subsequently attach to a bus and group.

You can also invoke the Monitor utility and specify the bus and group on the command line, as shown in the following format:

# dmqmonm -b bus_id -g group_id

Where:

-b bus_id

bus number

-g group_id

group number

You can run the Motif user interface from a character-cell monitor by setting the display. For example, if you are running the Monitor utility on node abc, you can display the Motif user interface on node xyz by using the following commands:

Before running a program that uses MessageQ, you must set up your environment to properly identify several paths, some of them platform specific.

You must define the environment variable BEADIR as the full path of the MessageQ installation directory. $BEADIR/lib must be included in the exported environment variable LIBPATH on AIX, SHLIB_PATH on HPUX, and LD_LIBRARY_PATH on all other Unix platforms.

You must also identify the message queuing bus and the message queuing group with which the program will be associated. A MessageQ program associates itself with a specified bus ID and group ID at runtime by obtaining the values of the DMQ_BUS_ID and DMQ_GROUP_ID environment variables.

To set environment variables that designate a bus and group ID using csh syntax, enter the following commands:

# setenv DMQ_BUS_ID bus_id# setenv DMQ_GROUP_ID group_id

To set environment variables that designate a bus and group ID using sh syntax, enter the following commands:

# DMQ_BUS_ID = bus_id# export DMQ_BUS_ID

# DMQ_GROUP_ID = group_id# export DMQ_GROUP_ID

You must set these environment variables each time you install a new version of MessageQ for UNIX software.

Note that all MessageQ application programs, except those running on clients, should run under the same user identifier.

Descriptive alphanumeric name for this group. No spaces or special characters are allowed.

-l logfile_name

Optional log file name. You must specify a pathname and file specification. Note that if you do not use a log file, the output displays to the screen in an "unformatted" manner.

MessageQ uses the bus ID and the group ID to locate configuration information for a given application. See the topic in the previous section for more information.

You must set the NLSPATH environment variable, which allows MessageQ to properly translate error codes into text strings. MessageQ error or informational messages are displayed on your monitor screen. To set the NLSPATH variable, enter the following command:

MessageQ offers a shutdown procedure to shut down a running group immediately. The MessageQ shutdown procedure executable image is dmqshutdown, and is run interactively by entering the following command:

# dmqshutdown -b bus_id -g group_id -f

Where:

-b bus_id

Numeric bus ID; maximum of four digits.

-g group_id

Numeric group ID; maximum of five digits.

-f

Fast shutdown. If you select this option, MessageQ terminates all MessageQ processes in the group immediately. When the group is stopped, messages can no longer be delivered to the queues and all pending messages in the queues are lost

The group shutdown procedure stops all queues immediately without draining the messages in the queues. Further, it stops all links immediately and provides an orderly shutdown of all MessageQ processes.

If you enter y, MessageQ stops all queues in the group, allowing them to be emptied. Applications can continue to read messages from the queues until all are empty. However, applications cannot place messages in the queues. After all the queues are empty, the MessageQ processes in the group will terminate.

If you enter n, MessageQ terminates all MessageQ processes in the group immediately. When the group is stopped, messages can no longer be delivered to the queues and all pending messages in the queues are lost. You can use this option to stop a group immediately even after selecting that the group stops gracefully.

If you select Soft Shutdown, MessageQ stops all queues in the group, allowing them to be emptied. Applications can continue to read messages from the queues until all are empty. However, applications cannot place messages in the queues. After all the queues are empty, the MessageQ processes in the group will terminate.

If you select Fast Shutdown, MessageQ terminates all MessageQ processes in the group immediately. When the group is stopped, messages can no longer be delivered to the queues and all pending messages in the queues are lost.

You can start a cross-group connection, also called a Link, using the MessageQ Monitor utility. The following procedures describe how to start a Cross-Group connection using the character cell or Motif interface.

If you enter y, MessageQ stops the specified queue in an orderly manner. When stopped gracefully, a queue will no longer accept new messages; however, it does allow messages to be read until the queue is empty. When the queue is empty, the queue will be placed in a stopped state.

If you enter n, MessageQ stops the specified queue immediately. A stopped queue will not accept any new messages and will not allow messages to be read from the queue. You can use this option to stop a queue immediately even after selecting that the queue stops gracefully.

The CLS security file is a text file containing a table of client entries. Each client entry contains a list of endpoints and queues which the client may use. CLS uses the security file to restrict access by remote clients to those endpoints and queues. MessageQ groups can have their own separate security files, or can share one file jointly.

Node -- The node name is usually the TCP/IP hostname for the client. The node name may also be an IP Address (for example, 1.23.45.156) or an alias name as defined in the TCP/IP hosts table on the CLS server system.

Endpoint -- The endpoint access is defined by a list of 0 or more endpoints that this client can use. The endpoint list may contain up to 10 different endpoints. An empty endpoint list defaults to allowing access to any endpoint with no restrictions.

Queue access -- The queue access identifies a list queues that this client can use. The queue list may contain up to 10 different queues. An empty queue list defaults to allowing access to any queue with no restrictions. Queues can be identified by queue names or queue numbers. Clients can also be restricted to allow access only to temporary queues by entering Temporary in this field.

You can create a security file in one of two ways:

Edit the template file that is distributed in the /templates directory of the media kit.

On Windows systems, you can use the Security Utility to edit the security file.

For LIBRARY client servers on UNIX systems, a template security file is available at the following location:

/install_dir/templates/dmqclsec.txt

Begin by making a copy of the template security file. Then, edit the copy to remove the sample entries and add entries for the client systems in your environment. Copy the file to its target location and then associate the security file with the message queuing group. Refer to Table 3-5 for a description of how to associate a security file with a message queuing group.

When a CLS is started, it loads the security file specified in the %CLS section of the group initialization file. If no security file is specified, CLS will not restrict access by remote clients. Each CLS can have a separate security file, or a security file can be shared by multiple CLS processes.

For information about the CLS Security Utility, refer to the MessageQ Client for Windows User's Guide.

MessageQ Message Recovery Services (MRS) provide a mechanism for guaranteed message delivery by storing messages on disk and automatically attempting redelivery until the message is received by the target system.

If you enabled MRS as part of your group configuration, you can replay the contents of postconfirmation or dead letter journals using the Journal Replay utility. You may also print the contents of postconfirmation, dead letter, destination queue, or store-and-forward journals using the Journal Dump utility.

All journal file names are 16 characters long. Each journal file name contains a 12-digit filename, a dot, and a 3-character extension that identifies the journal type. Note that journal file names are unique within a bus, but not between buses. Therefore, message queuing environments running more than one message queuing bus must ensure that journal files are not accidentally shared by groups running on different message queuing buses.

Caution: Do not use the Journal Replay utility on live recovery journals. Always make a copy of a live journal and run the utility against the copy. Using the Journal Replay utility on a live journal can cause irrecoverable file corruption.

The Journal Replay utility lets you resend the contents of postconfirmation or dead letter journals. The Journal Replay utility can use live recovery journals; however, if the journal file is currently in use, you must make a copy of the file before you can replay it. The Journal Replay utility can resend the entire journal file.

Messages sent from the postconfirmation or dead letter journal will be sent using the same source address, target address, delivery mode, and user notification. If the original message requested notification, the notification message is directed to the journal replay process instead of the original sender program.

The Journal Dump utility lets you produce a formatted report of the contents of a dead letter journal, postconfirmation journal, destination queue file, or a store and forward file. The Journal Dump utility can be used to print a live journal file if it is not in use. If the journal file is in use, you must halt the message recovery system for the group, and then use the Journal Dump utility to print the contents of the journal file.

To run the Journal Dump utility, enter the following command syntax (switches enclosed in parentheses indicate optional command qualifiers):

You can use the Loader utility to dynamically reload the group initialization file without having to shutdown and restart MessageQ. The Loader utility lets you enter modified settings or parameter values into a running group initialization file.

To run the Loader utility, enter the following command format:

dmqloader -b n -g n -f init_file_path [-l logfile]

Where:

-b

Numeric Bus ID; maximum of 4 digits

-g

Numeric Group ID; maximum of 5 digits

-f

The pathname and file specification of the group initialization file

-l

Optional log file. You must specify a pathname and file specification

Table 4-3 describes the parameters in the group initialization file that can be modified at runtime.

YES. CLS must be stopped. This parameter applies to OpenVMS systems only.

YES. CLS must be stopped.

%XGROUP

RECONNECT

RECONN_TIMER

WINDOW_DELAY

WINDOW_SIZE

YES. The link must be disabled.

YES. The link must be disabled.

YES. The link must be disabled.

NO

%QCT

BYTE_QUOTA

MESSAGE_QUOTA

MESSAGE_QUOTA_ENABLE

BYTE_QUOTA_ENABLED

TYPE

OWNER

MRS_CONFIRM_STYLE

PERM_ACTIVE

SECURITY_ENABLED

NO

NO

NO

NO

YES. The queue must be empty and have no processes attached. When changing a primary queue to a secondary queue, the primary queue cannot have any secondary queues defined.

YES. The queue must be empty and have no processes attached. To set this parameter to a value other than zero, the queue must be defined as a secondary queue, and the owning queue must be defined and be a primary queue.

The MessageQ Monitor utility lets you enable or disable quotas on permanent queues that you previously defined in the %QCT section of the group initialization file. You can enforce quotas on the maximum number of collected messages and bytes that can reside in a given queue. For more information on setting these quotas in the %QCT section, see Defining Queues in the Queue Configuration Section in Chapter 3.

If you are not concerned whether your application exceeds quotas, you should disable quotas to increase performance and reduce screen clutter.

MessageQ lets you protect a queue from unauthorized reading by implementing an Access Control List (ACL) queue security. When set, the queue security prevents a process from attaching to a queue if the process does not have privilege to open a protected file on disk. MessageQ implements this security feature by creating a directory tree structure in the /var/tmp/dmq directory. The pathname to the security file for a selected queue is a combination of the bus, group, and queue number as follows:

/var/tmp/dmq/b_xxxx/g_yyyyy/acl/q_zzzz

Where:

xxxx

The number of the bus in decimal with leading zeros.

yyyyy

The number of the group in decimal with leading zeros.

zzzz

The number of queues in decimal with leading zeros.

For example, the security file for queue 50 in group 2 of bus 777 is:

/var/tmp/dmq/b_0777/g_00002/acl/q_0050

To configure a queue to use queue security, place the letter "y" in the last column of a queue entry in the %QCT section of the group initialization file, as follows:

If the file system is shared for the ACL files for two different releases of MessageQ, there must be two versions of each security file.

If you specify queue security and the security file does not exist, you will not be able to attach the queue and you will receive the error status PAMS__NOACL. If the security queue file exists, you must have read/write access to the security file to attach the queue. If you cannot open the file for read/write access, the attach operation will fail and return the error status PAMS__NOPRIV.

The commands used to set file protections can vary depending on the file system. For most UNIX systems, the commands chmod, chown, and chgrp are used to set file protection. For more information about setting file protection, refer to the user documentation for the file system you are using.

Queue numbers with a number greater than Temporary Queue (FIRST_TEMP_QUEUE) are dynamically assigned. The BYTE_QUOTA and MSG_QUOTA values for dynamically assigned queues are set from the TEMPLATE entry in the %QCT section. Do not change any other value in the TEMPLATE queue entry.

Previous versions of MessageQ required you to enable or disable queue quotas for an entire message queuing group. However, you can now enable queue quotas on a per queue basis on UNIX systems. You can enable or disable message and byte quotas for a selected queue at startup by setting the Quota Enable field for each entry in the %QCT section of the group initialization file. contains the values that you can specify for the QUOTA_ENABLED attribute.

You can use the Monitor utility to enable or disable message and byte quotas for a selected queue at runtime. (See the Enabling Quotas topic for more information.)

The MessageQ link drivers provide parameters that let you define timeout intervals for testing the state of a cross-group connection or aborting a connection with a cross-group link. These parameters are implemented as the following environment variables:

DMQLD_PING_INTERVAL

Specifies the amount of time a Link Sender process should wait before issuing another ping message to test the state of an idle connection. The ping interval is the number of seconds between tests. The default value is 30 seconds.

DMQLD_PING_TIMEOUT

Specifies the amount of time a Link Sender should wait for a response to a ping message before aborting. The default value is 60 seconds.

When tracing is enabled, the Link Receiver logs successful ping responses to the group log file.

If you must use a value other than the default, set both environment variables before starting your group.