Controlling accounting messages

The collection of accounting information is controlled by a set of queue manager, and queue attributes.

 

Collecting MQI accounting information

The collection of MQI accounting information is controlled by the queue manager attribute, ACCTMQI. To change the value of this attribute we can use the MQSC command,

ALTER QMGR, and specify the parameter, ACCTMQI. This parameters can have the following values:

ON

MQI accounting information is collected for every connection to the queue manager.

OFF

MQI accounting information is not collected. This is the default value.

For example, to enable MQI accounting information collection use the following MQSC command:

ALTER QMGR ACCTMQI(ON)

 

Collecting queue accounting information

The collection of queue accounting information is controlled by the queue attribute, ACCTQ, and the queue manager attribute, ACCTQ. To change the value of the queue attribute, we can use the MQSC command,

ALTER QLOCAL and specify the parameter

ACCTQ.

The queue attribute, ACCTQ, can have the following values:

ON

Queue accounting information for this queue is collected for every connection to the queue manager that opens the queue.

OFF

Queue accounting information for this queue is not collected.

QMGR

The collection of queue accounting information for this queue is controlled according to the value of the queue manager attribute, ACCTQ. This is the default value.

The queue manager attribute, ACCTQ, can have the following values:

ON

Queue accounting information is collected for queues that have the queue attribute ACCTQ set as QMGR.

OFF

Queue accounting information is not collected for queues that have the queue attribute ACCTQ set as QMGR. This is the default value.

NONE

The collection of queue accounting information is disabled for all queues, regardless of the queue attribute ACCTQ.

To enable accounting information collection for the queue,

Q1, use the following MQSC command:

ALTER QLOCAL(Q1) ACCTQ(ON)

To enable accounting information collection for all queues that specify the queue attribute ACCTQ as QMGR, use the following MQSC command:

ALTER QMGR ACCTQ(ON)

If the queue manager attribute, ACCTQ, is set to NONE, the collection of queue accounting information is disabled for all queues, regardless of the queue attribute ACCTQ.

 

Controlling accounting information collection using MQCONNX

The collection of both MQI and queue accounting information can also be modified at the connection level by specifying the ConnectOpts parameter on the MQCONNX call. By altering the value of ConnectOpts, it is possible to override the effective value of the queue manager attributes ACCTMQI and ACCTQ.

ConnectOpts can have the following values:

MQCNO_ACCOUNTING_MQI_ENABLED

If the value of the queue manager attribute ACCTMQI is specified as OFF, then MQI accounting is enabled for this connection. This is equivalent of the queue manager attribute ACCTMQI being specified as ON.

If the value of the queue manager attribute ACCTMQI is not specified as OFF, then this attribute has no effect.

MQCNO_ACCOUNTING_MQI_DISABLED

If the value of the queue manager attribute ACCTMQI is specified as ON, then MQI accounting is disabled for this connection. This is equivalent of the queue manager attribute ACCTMQI being specified as OFF.

If the value of the queue manager attribute ACCTMQI is not specified as ON, then this attribute has no effect.

MQCNO_ACCOUNTING_Q_ENABLED

If the value of the queue manager attribute ACCTQ is specified as OFF, then queue accounting is enabled for this connection. All queues with ACCTQ specified as QMGR, are enabled for queue accounting. This is equivalent of the queue manager attribute ACCTQ being specified as ON.

If the value of the queue manager attribute ACCTQ is not specified as OFF, then this attribute has no effect.

MQCNO_ACCOUNTING_Q_DISABLED

If the value of the queue manager attribute ACCTQ is specified as ON, queue accounting is disabled for this connection. This is equivalent of the queue manager attribute ACCTQ being specified as OFF.

If the value of the queue manager attribute ACCTQ is not specified as ON, then this attribute has no effect.

These overrides are by disabled by default. To enable them, set the queue manager attribute ACCTCONO to ENABLED. To enable accounting overrides per connection use the following MQSC command:

ALTER QMGR ACCTCONO(ENABLED)

 

Generating accounting messages

Accounting messages are generated upon the disconnection of the application from the queue manager, either upon the execution of the MQDISC operation, or implicity by the queue manager upon the recognition of the termination of the application.

Intermediate accounting messages are also written for long running WebSphere MQ applications when the interval since the connection was established or since the last intermediate accounting message that was written exceeds the configured interval. The queue manager attribute, ACCTINT, specifies the time, in seconds, after which intermediate accounting messages can be automatically written. Accounting messages are only generated when the application interacts with the queue manager, so applications that remain connected to the queue manager for long periods without executing MQI requests will not generate accounting messages until the execution of the first MQI request following the completion of the accounting interval.

The default accounting interval is 1800 seconds (30 minutes). For example, to change the accounting interval to 900 seconds (15 minutes) use the following MQSC command:

ALTER QMGR ACCTINT(900)