How to: Write a message to the console for a situation
You can use the Take Action command ZOSWTO (z/OS WTO) to write a message to the z/OS operator console for a situation.
Before you begin
You can use the Take Action command ZOSWTO when creating a situation using any of the available methods (such as, Tivoli Enterprise Portal, enhanced 3270 user interface, tacmd CLI).
About this task
When defined for a situation, the Take Action command ZOSWTO writes a multi-line write-to-operator (WTO) message to the operator console when the situation occurs. The multi-line WTO is issued on the z/OS monitoring server (TEMS) that an agent is connected to or on a z/OS monitoring agent (TEMA). The message is produced when the situation is true or false. Any data that follows the command name will be present in the multi-line message.
ZOSWTO user_supplied_content
When the situation is triggered, message KO41041I is issued in the operator console in the following format:
KO41041I SITUATION EVENT situation_event_id
situation_name:node_name <optional_display_item_value> T|F user_supplied_content
The situation event is identified in the multi-line message by the
situation_event_id. situation_name is the name of the
situation, and node_name is the origin node related to the event.
optional_display_item_value is the display item, if one is defined for the
situation. The message is produced when the situation is true (T
) or false
(F
). The user_supplied_content is the content as defined in the
ZOSWTO command. When the situation is false, the values of substitution variables
in the user_supplied_content are N/A
.
The message data is divided into 70-character sections on a maximum of five consecutive lines.
KO41041I
, you will need to parse other details to differentiate the
messages. The ability to scan for unique, known information can help to quickly identify the
messages for a specific situation.ZOSWTO [routing_code/descriptor_code] user_supplied_content
ZOSWTO [*routing_code/*descriptor_code] user_supplied_content
Procedure
KO41041I
, with a maximum of five
consecutive lines, is written to the operator console.Example
This example describes how to use the ZOSWTO command to write a message to the console for a specific situation that is detected by the IBM OMEGAMON for Messaging on z/OS, IBM MQ Monitoring agent. This example provides implementation steps for both the enhanced 3270 user interface and the Tivoli Enterprise Portal, and also provides sample output messages.
MQ01W
, which will be used for message identification in the log. ZOSWTO MQ01W Event queue depth high for Qmgr:&{Current_Events.Reporting_MQ_Manager_Name}; Queue:&{Current_Events.Resource_Name}
To associate this WTO message with the situation, you must define it as a Take Action System Command in the situation. The following sections show how to do this in the enhanced 3270 user interface and the Tivoli Enterprise Portal. Examples of the produced messages in the operator console are also provided.
- Define the ZOSWTO command using the enhanced 3270 user interface
-
Use the Formula tab in the Situation Editor to define the criteria for the situation, as shown in the following figure:
Notice the following in this example:- A display item is set so that it will become true for each possible queue. The display item will
be included in the WTO message (as
<optional_display_item_value>
) when the situation event occurs. - The formula for this situation is as follows:
*IF *VALUE Current_Events.Event *EQ Queue_Depth_High
Then, use the Action Tab of the Situation Editor to enter the ZOSWTO command as a System Command. You must type S next to Command to enter the complete value of the command, as shown in the following figures:
- A display item is set so that it will become true for each possible queue. The display item will
be included in the WTO message (as
- Define the ZOSWTO command using the Tivoli Enterprise Portal
-
Use the Formula tab in the Situation Editor to define the criteria for the situation. For this example, the formula is the == Queue Depth High event, as shown in the following figure.Note: This situation also has a display item set so that it will become true for each possible queue. The display item will be included in the WTO message (as
<optional_display_item_value>
) when the situation event occurs.Then, on the Action Tab of the Situation Editor, enter the ZOSWTO command as a System Command, as shown in the following figure:
- View the WTO messages in the operator console
-
When this situation occurs (that is, when the situation is true), the following WTO message appears in the operator console: When this situation clears (that is, when the situation is false), the following WTO message appears in the operator console: