Configuring diagnostic message services

You configure the IBM® MQ diagnostic message services by using commands to edit the qm.ini and mqs.ini files.

About this task

Each of the available message services is configured by editing stanzas in the qm.ini and mqs.ini files. You cannot edit these files directly, so must use the dspmqini command to view stanzas and the setmqini command to update them. These commands are run at the mqcli prompt.

You update the stanzas to configure the DiagnosticSystemMessages, DiagnosticMessages, and DiagnosticMessagesTemplate services. You can also use these methods to update the stanzas for the service that handles the innate IBM MQ error and information messages, QMErrorLog, and for the service that makes messages available for log targets, Appliance. For the Appliance service you can only specify the filtering attributes.

Changes to the DiagnosticMessages service stanzas in qm.ini only take effect after the queue manager is restarted.

Procedure

  • To view the stanza for all the DiagnosticSystemMessages services defined in the mqs.ini file, enter the following command:
    dspmqini -g -s DiagnosticSystemMessages
  • To view the stanza for a specific DiagnosticSystemMessages service, enter the following command:
    dspmqini -g -s DiagnosticSystemMessages -n service_name
  • To configure a stanza for a DiagnosticSystemMessages service, enter the following command:
    setmqini -g -s DiagnosticSystemMessages -n service_name -k key_name -v key_value
    The possible options for the -k argument are:
    • MessageDetail
    • Service
    • ExcludeMessages
    • Severities
    • FilePrefix
    • FileSize
    • Format
    See IBM MQ diagnostic message services for a fuller description of each key, and possible values.
  • To view the stanza for all the DiagnosticMessages services defined in the qm.ini file for a particular queue manager, enter the following command:
    dspmqini -m queue_manager -s DiagnosticMessages 
  • To view the stanza for a specific DiagnosticMessages service, enter the following command:
    dspmqini -m queue_manager -s DiagnosticMessages -n service_name
  • To configure a stanza for a DiagnosticMessages service for a queue manager, enter the following command:
    setmqini -m queue_manager -s DiagnosticMessages -n service_name -k key_name -v key_value
    The possible options for the -k argument are:
    • MessageDetail
    • ExcludeMessages
    • SuppressMessages
    • SuppressInterval
    • Severities
    • FilePrefix
    • FileSize
    • Format
    See IBM MQ diagnostic message services for a fuller description of each key, and possible values.
  • To view the stanza for all the DiagnosticMessagesTemplate services defined in the mqs.ini file, enter the following command:
    dspmqini -g -s DiagnosticMessagesTemplate
  • To view the stanza for a specific DiagnosticMessagesTemplate service, enter the following command:
    dspmqini -g -s DiagnosticMessagesTemplate -n service_name
  • To configure a stanza for a DiagnosticMessagesTemplate service, enter the following command:
    setmqini -g -s DiagnosticMessagesTemplate -n service_name -k key_name -v key_value
    The possible options for the -k argument are:
    • MessageDetail
    • ExcludeMessages
    • SuppressMessages
    • SuppressInterval
    • Severities
    • FilePrefix
    • FileSize
    • Format
    See IBM MQ diagnostic message services for a fuller description of each key, and possible values.

Example

The following commands configure a DiagnosticSystemMessages service named SystemErrors that records messages with a severity of error, stop, or system, and writes them to files with the prefix 'SystemErrorsFile'.
setmqini -g -s DiagnosticSystemMessages -n SystemErrors -k Service -v File
setmqini -g -s DiagnosticSystemMessages -n SystemErrors -k Severities -v E+
setmqini -g -s DiagnosticSystemMessages -n SystemErrors -k FilePrefix -v SystemErrorsFile
To view the stanza that you have just configured, enter the following command:
dspmqini -g -s DiagnosticSystemMessages -n SystemErrors
The following stanza is displayed:
DiagnosticSystemMessages:
  Service    = File
  FilePrefix = SystemErrorsFile
  Name       = SystemErrors
  Severities = E+
The following commands configure a DiagnosticMessages service named Filtered that suppresses multiple messages that report the start and end of channel programs within a one minute interval. Messages are written to files with the prefix 'TasksSuppressed'.
setmqini -m QM1 -s DiagnosticMessages -n Filtered -k Service -v File
setmqini -m QM1 -s DiagnosticMessages -n Filtered -k SuppressMessage -v 9001,9002
setmqini -m QM1 -s DiagnosticMessages -n Filtered -k SuppressInterval -v 60
setmqini -m QM1 -s DiagnosticMessages -n Filtered -k FilePrefix -v TasksSuppressed
To view the stanza that you have just configured, enter the following command:
dspmqini -m QM1 -s DiagnosticMessages -n Filtered
The following stanza is displayed:
DiagnosticMessages:
  Service          = File
  SuppressMessage  = 9001,9002
  FilePrefix       = TasksSuppressed
  SuppressInterval = 60
  Name             = Filtered

The following example updates the DiagnosticMessages service that makes queue manager log information available to be sent to an appliance log target. The update applies the same filter as applied in the previous example:

setmqini -m QM1 -s DiagnosticMessages -n LogTarget -k SuppressMessage -v 9001,9002
setmqini -m QM1 -s DiagnosticMessages -n LogTarget -k SuppressInterval -v 60
setmqini -m QM1 -s DiagnosticMessages -n LogTarget -k FilePrefix -v TasksSuppressed

To view the stanza that you have just configured, enter the following command:

dspmqini -m QM1 -s DiagnosticMessages -n LogTarget
The following stanza is displayed:
DiagnosticMessages:
  Name    = LogTarget
  Service = Appliance
  SuppressMessage  = 9001,9002
  FilePrefix       = TasksSuppressed
  SuppressInterval = 60

For information on how to go on to configure the log target, see Appliance log targets.