This chapter contains topics that describe how to manage MessageQ software on your system from the command line or from the MessageQ Monitor utility.
The topics include:
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:
Using the Monitor Utility
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:
To invoke the character-cell user interface and specify the bus and group, use the following command format:
Where: Invoking the Character-Cell Interface
# dmqmonc
# dmqmonc -b bus_id -g group_id
|
bus number |
|
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:/usr/kits/DMx
400/bin/%U
The DM
x
can be either of the following:
|
Digital UNIX systems |
|
Other UNIX systems |
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:/usr/kits/DMx
400/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 -bbus_id
-ggroup_id
Where:
|
bus number |
|
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:
csh Syntax | sh Syntax |
---|---|
|
|
|
|
Before running a program that uses MessageQ, you must set the environment to 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_IDbus_id
# setenv DMQ_GROUP_IDgroup_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.
You can connect to a group from the MessageQ Monitor utility. The following procedures describe how to connect to a group using the character cell or Motif interface.
Use the following procedure to connect to a group:
Use the following procedure to connect to a group:
To start MessageQ for UNIX systems, you must invoke the MessageQ startup procedure (dmqstartup
) to start each referenced group in the group initialization file.
The MessageQ startup procedure executable image is dmqstartup
, and is run interactively by entering the following command:
# dmqstartup -bbus_id
-ggroup_id
-ffilespec
-ngroup_name
[-llogfile_name
]
Where:
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:
% setenv NLSPATH /usr/lib/nls/msg/%N:/usr/kits/DMx
400/lib/nls/msg/%N
You can start a group from the MessageQ Monitor utility. The following procedures describe how to start a group using the character cell and Motif interfaces.
Use the following procedure to start a group:
For example: /user3/users/jones/bigfile.init
For example:
Note:
If you do not use a log file, the output displays to the screen in an "unformatted" manner, making it difficult to read.
MessageQ displays the message: /user3/users/jones/group10.log
Group# (#) is started
.
Use the following procedure to start a group:
Select the Manage pull-down menu.
Select Start.
For example: /user3/users/jones/bigfile.init
For example:
Note:
If you do not use a log file, the output displays to the screen in an "unformatted" manner, making it difficult to read.
/user3/users/jones/group10.log
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 -bbus_id
-ggroup_id
Where:
|
Numeric bus ID; maximum of four digits. |
|
Numeric group ID; maximum of five digits. |
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.
You can shutdown a group from the MessageQ Monitor utility. The following procedures describe how to shutdown a group using the character cell or Motif interface.
Use the following procedure to shutdown a group:
MessageQ displays the question: Stop gracefully, y or n?
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.
Use the following procedure to shutdown a group:
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.
Are you sure you really want to shutdown group #?
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.
Use the following procedure to start a cross-group connection:
MessageQ prompts you to enter the number of the group to which you want to form a cross-group connection.
A successful return code is indicated with the message:
Link to Group # is started.
Use the following procedure to start a cross-group connection:
You can stop a cross-group connection using the MessageQ Monitor utility. The following procedures describe how to stop a cross-group connection using the character cell or Motif interface.
Use the following procedure to stop a cross-group connection:
MessageQ prompts you to enter the number of the group for which you want the cross-group connection stopped.
MessageQ immediately disables the link, which causes all cross-group communication with the selected group to cease. A successful return code is indicated with the message:
Note:
To restart the link, you must issue the start command from the node that stopped the link. The link cannot be restarted from the remote node with which it was communicating.
Link to Group # is stopped.
Use the following procedure to stop a cross-group connection:
You can start a queue using the MessageQ Monitor utility. The following procedures describe how to start a queue using the character-cell or Motif interface.
Use the following procedure to start a queue:
Use the following procedure to start a queue:
You can stop a queue using the MessageQ Monitor utility. The following procedures describe how to stop a queue using the character-cell or Motif interface.
Use the following procedure to stop a queue:
MessageQ displays the question:
Stop gracefully, y or n?
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.
Use the following procedure to stop a queue:
You can start and stop the CLS from the MessageQ Monitor utility. The following procedures describe how to start and stop the CLS using the character-cell or Motif interface
Use the following procedure to start the CLS:
Use the following procedure to start the CLS:
Use the following procedure to stop the CLS:
Use the following procedure to stop the CLS:
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.
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:
/usr/kits/DMx
400/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 group, but not between groups. 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.
Valid journal filenames are of the format:
Format | Journal Type |
---|---|
|
Destination Queue File |
|
Store and Forward |
|
Postconfirmation Journal |
|
Dead Letter Journal |
Where:
|
Four-digit local group number in hexadecimal. |
|
Four-digit queue number in hexadecimal. |
|
Four-digit remote group number in hexadecimal. |
|
File sequence number in hexadecimal within a set of files. |
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.
To invoke the Journal Replay utility, enter the following command syntax. Switches enclosed in parentheses indicate optional command qualifiers.
dmqjplay -bbus
-ggroup
-mmode
-tjournal_type
-jjournal_path
[-llog_path
]
Table 4-1 describes the command options for dmqjplay
.
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):
dmqjdump -bbus
-ggroup
-qqueue
-tjournal_type
-hheader_type
-mmessage_format
-jjournal_path
[-d] [-llog_path
] [-ooutput_file
] [-nnumber
]
Table 4-2 describes the command options for dmqjdump
.
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 -bn
-gn
-finit_file_path
[-llogfile
]
Where:
Table 4-3 describes the parameters in the group initialization file that can be modified at runtime.
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.
Enable or disable quotas using the following procedure:
MessageQ displays the message: Quotas enabled or Quotas disabled.
Use the following procedure to enable or disable quotas:
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_yyyy
/acl/q_zzz
Where:
|
The number of the bus in decimal with leading zeros. |
|
The number of the group in decimal with leading zeros. |
|
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_050
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:
QUEUE1 1 64000 100 None . P 0 . N Y
(See the Defining Queues in the Queue Configuration Section topic in Chapter 3 for more information on how to configure a queue.)
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:
If you must use a value other than the default, set both environment variables before starting your group.