Message queue file self-monitoring


When the HPOM management server receives messages, it stores them temporarily in a message queue file before processing them. The maximum size of a this file is 2 GB. The operating system components that the management server uses do not support larger files. If the file size grows beyond 2 GB, the file becomes corrupt. The management server loses messages from the file, and cannot process new messages.

Under normal conditions this problem does not occur. However, the following circumstances could lead the message queue file to grow uncontrollably:

To prevent the message queue file becoming corrupt, the management server monitors the size of this file. By default, if the file size approaches 2 GB, the management server rejects new messages until the file size returns to normal. Agents start to buffer rejected messages locally, and try to resend them later. Therefore, you do not lose the messages that the management server rejects.

The management server sends a high-priority message to connected consoles when the file approaches 2 GB, and also when the file drops back to a safe size. When it sends these high-priority messages, the management server bypasses the agent and the message queue. (You cannot create high-priority messages using policies.)

You can change this default behavior in the following ways:

Configuration values for message queue file self-monitoring

You can configure message queue file monitoring by changing values in the Message Queue File Monitoring namespace using the Server Configuration dialog box. The following table describes the values that you can change.

Value Default Description
Message queue monitoring mode 2

This value configures the action that the management server takes when the message queue file size reaches the configured maximum.

Set one of the following values:

  • 0 - Ignore this problem and let the queue file keep growing. If the file size grows beyond 2 GB, the file becomes corrupt.
  • 1 - Send a high-priority message to connected consoles, but continue accepting messages. Reject messages only if the file size reaches 2 GB.
  • 2 - Send a high-priority message to connected consoles, and reject new messages, so that agents buffer messages locally. Accept messages again only if the message queue file size drops below the configured Message queue rearm file size.
Message queue maximum file size 2147473407

This value configures the maximum file size to which the message queue file is allowed to grow before the monitor takes the action defined in Message queue monitoring mode.

Set a value in bytes between 20000000 (about 19 MB) and 2147473407 (2 GB minus 10 KB). If you configure a value that is outside this range, the management server uses the default value.

Message queue rearm file size 2146435071

This value configures the file size to which the message queue file size must return after reaching the configured maximum. When the message queue file returns to a size below this threshold, the management server sends a high priority message to connected consoles. If the value Message queue monitoring mode is 2, the management server also begins accepting messages again.

Set a value in bytes that is smaller than the Message queue maximum file size.

The value must also be between 256000 (about 250 KB) and 2146435071 (2 GB minus 1 MB). If you configure a value that is outside this range, the management server uses a value that is half the defined message queue maximum file size.

Severity of queue warning messages 32

This value configures the severity of the high-priority message that the management server sends when the message queue file size reaches the configured maximum.

Set one of the following numeric values:

  • 2 - Normal
  • 4 - Warning
  • 8 - Minor
  • 16 - Major
  • 32 - Critical

Note NOTE:
The message that the management server sends when the message queue file size drops below the configured Message queue rearm file size has normal severity. You cannot configure the severity of this message.

Message key prefix for queue warning messages Empty string (no message key defined)

This value configures a prefix for the message key of the high-priority messages about the message queue file size. The management server constructs the message key in the format: <UserDefinedPrefix>:QueueFileSize:MsgQueue.

If you configure this value, the message that the management server sends when the message queue file size returns to below Message queue rearm file size automatically acknowledges the previous high-priority message.

If you leave this value empty, the message key remains blank, which prevents automatic acknowledgement of these messages.

Automatic action for queue warning messages Empty string (no automatic action defined)

This value specifies the name of a command file (.cmd or .bat) or script file (.vbs) to add as an automatic command to high-priority messages about the message queue file size. (This enables you, for example, to configure an automatic command that pages an operator or sends an urgent email.)

The management server bypasses the agent and runs the automatic command immediately. The management server adds the results of the automatic command as an annotation to the high-priority message.

When the management server runs the command file or script, it automatically adds the following parameters, which your command file or script can evaluate:

<ReasonOfCall>
Specifies the reason why the automatic command was called. This can be one of the following values:
  • 0 - The message queue file size is back to normal.
  • 1 - The message queue file size has reached the configured maximum.
  • 2 - The message queue file size has reached the system limit of 2 GB.
<MessageId>
ID of the high-priority message.
<CurrFileSize>
Current size of the message queue file in bytes (before adding the new message).
<ReqFileSize>
Required size of the message queue file in bytes (if the new message were added).
<QueueFileName>
Fully qualified name of the message queue file.

You can use the following command file as a template: %OvInstallDir%\bin\OvMsgQueueMonAutoActionTmpl.cmd.

Operator-initiated action for queue warning messages empty string (no operator-initiated action defined)

This value specifies the name of a command file (.cmd or .bat) or script file (.vbs) to add as an operator-initiated command to high-priority messages about the message queue file size.

When the operator starts this command, the management server bypasses the agent and runs the command immediately. The management server automatically appends parameters for your command file or script to evaluate. These are the same parameters that the management server appends to automatic commands (see above).

You can use the following command file as a template: %OvInstallDir%\bin\OvMsgQueueMonOperatorActionTmpl.cmd

Testing message queue file self-monitoring

Before you use customized message queue file self-monitoring in a production environment, test whether it works as you expect. Consider the following questions:

Normally, it is difficult to create tests that cause the message queue file size to reach the configured maximum. The permitted ranges for configuration values suit production environments, but for testing it is desirable to configure smaller values.

In a test environment, you can specify values that are smaller than normally permitted for Message queue maximum file size and Message queue rearm file size by defining negative values. The management server interprets these negative values as test values and automatically converts to them to positive values without checking whether the values are permitted.

Note Caution:
Perform tests in a test environment. Do not use negative values in production environments.

The following example explains a test case that sends a high-priority message if the message queue file size reaches 20000 bytes. In this example, the management server continues to accept new messages. When the message queue file returns to size below 10000 bytes, the management server sends a second high-priority message.

  1. Set the following values appropriately:
  2. Set Message queue monitoring mode to 1.
  3. Set Message queue maximum file size to -20000
  4. Set Message queue rearm file size to -10000.
  5. Use opcmsg to create test messages and use Windows Explorer to check the size of the file %OvShareDir%\tmp\queues\MsgQueue. When the file size reaches 20000 bytes (which happens quickly), check that a high-priority message appears in the console for the management server node.
  6. Check whether the automatic command completes successfully and that the results appear as an annotation to the high-priority message.
  7. Start the operator-initiated command, and check the results.
  8. Continue to send new messages until the message queue file size reaches approximately 265000 bytes. The file size automatically reduces. Check that a second high-priority message appears in the console.
  9. Check whether the automatic and operator-initiated commands complete successfully for the second high-priority message.
  10. Check that the second high-priority message automatically acknowledges the first high-priority message.

Related Topics: