Editing situations
This example describes how to use the PATCH /situations endpoint to edit
situations.
- The name of the defined situation (the NAME property).
- The date when the situation was last modified (the LSTDATE property).
Specify this information as a timestamp value. Because this value is updated each time the situation
is edited, you must update the value with each
PATCH /situationsrequest.Note: This timestamp value is used as a locking mechanism to prevent multiple requests from updating the situation at the same time. For information about the format of the timestamp, see Using time values for requests.Tip: You can obtain this value by using theGET /situationsendpoint; the lstdate parameter is returned as part of the response. - The situation information to modify. The properties that can be updated are described in Request body for situation editing.
The format of the request slightly differs depending on if you are editing a single situation or multiple situations in your request, as described in the following sections.
Editing one situation per request
When using the PATCH /situations endpoint to edit a single situation, include in
the request body the NAME property, the
LSTDATE property, and the situation information to
modify.
https://host:port/api/v1/situationsThe properties that can be updated are described in Request body for situation editing.
Editing multiple situations in a request
When using the PATCH /situations endpoint to edit multiple situations in a
single request, you must use the NAME and LSTDATE
properties in the request body for each situation to update.
https://host:port/api/v1/situations[
{
"NAME" : "sit1",
"REEV_DAYS": "1",
"LSTDATE" : "01293012930293"
},
{
"NAME" : "sit2",
"REEV_DAYS": "1",
"LSTDATE" : "01293012930293"
}
]The properties that can be updated are described in Request body for situation editing.
Request body for situation editing
{
"NAME": "string",
"LSTDATE": "string",
"ADVISE": "string",
"AUTOSTART": "string",
"CMD": "string",
"FULLNAME": "string",
"PDT": "string"
"REEV_DAYS": "string",
"REEV_TIME": "string",
"SITINFO": {
"TFWD": "string",
"SEV": "string",
"TDST": "string",
"ATOM": "string",
"COUNT": "string"
},
"TEXT": "string",
"REFLEXACTION_OPTIONS": {
"EACH_ROW" : "string",
"EACH_INTERVAL" : "string",
"WHERE" : "string"
},
"DISTRIBUTION": [
"string"
]
}Always include in the request body the NAME and the LSTDATE properties. For the remainder of the properties, include only those properties that you want to update for the respective situation.
The following table describes the supported properties and provides the relevant location in the Tivoli Enterprise Portal (TEP).
| Property | Description | Location in TEP Situation Editor |
|---|---|---|
NAME |
The name of the defined situation. The NAME value is 31 characters or less, does not start with a number, and contains only alphanumeric characters or the underscore character. Note: This parameter is required.
|
Formula tab, Name field |
LSTDATE |
The timestamp when the situation was last modified. Because this value is updated each
time the situation is edited, you must update the value with each Note: This parameter is required.
|
|
FULLNAME |
The name value of the defined situation when the value does not meet the
NAME criteria. The name of the defined situation is stored as the FULLNAME attribute if it is longer than 31 characters, starts with a number, or contains symbols other than alphanumeric or the underscore character (for example, whitespace characters, question mark, exclamation mark). |
Formula tab, Name field |
TEXT |
Situation description. Valid values: character string, max length 64 bytes |
Formula tab, Description field |
PDT |
Formula containing the thresholds to be tested by the situation. Valid values: character string, max length 1022 characters
|
Formula tab, Formula fields |
SITINFO |
Situation definitions that are eligible for editing. The
When making updates to these properties, you must include all the SITINFO
properties that are defined for the situation. You can obtain the SITINFO
definitions by using the GET /situations endpoint. For example, consider a
situation with the following definitions:To change the value of the COUNT property from 1 to 2, you must
include all of the defined properties, as follows:For a description of each of the |
Formula and EIF tabs |
REEV_DAYS
|
Sampling interval. You can change it to as seldom as once in 999 days or as often as 30
seconds. Valid values:
For example, the following definitions create a sampling interval of 24 hours and 5
minutes: |
Formula tab, Sampling interval fields |
AUTOSTART |
Run at startup. Valid values: Specify
Specify |
Formula tab, Run at startup option |
DISTRIBUTION |
Managed systems where to run the situation. Use the following
format: where
node_n is one or more nodes (managed systems), listed in JSON array format, where
to run the situation.For example: When making updates to the DISTRIBUTION values, you must
include in the request all the node values that are currently defined for the situation. You can
obtain the defined values using the GET /situations endpoint. If you omit an entry,
the node is removed from distribution. You can also add nodes to distribution. Important:
|
Distribution tab, Assigned field |
ADVISE |
Expert advice. You can enter text that describes instructions for the user, or provide the URL of a page to display. | Expert Advice tab, Text or Advice Location field |
CMD |
Action to perform when the situation becomes true. To run a system command, use the
following format: where
system_command is the command to issue at the system.To issue a universal
message, use the following format: where:
|
On the Action tab:
|
REFLEXACTION_OPTIONS |
Indicate the reflex action options to take when the situation becomes true. The
When making updates to the |
Options on the Action tab: If the condition is true for more than
one monitored item:
Where should the Action be executed:
If the condition stays true over multiple intervals:
|
SITINFO object:| Property | Description | Location in TEP Situation Editor |
|---|---|---|
TFWD |
Event Integration Facility (EIF) forwarding, which forwards situation events to one or more
EIF receivers. Specify Y to forward situation events to one or more EIF receivers. An EIF event is sent for each situation event. Valid values: Y, N |
EIF tab, Forward Events to an EIF Receiver option |
SEV |
The severity for forwarded situation events. | EIF tab, EIF Severity field |
TDST |
Event Integration Facility (EIF) destinations for the forwarded events. Each destination
represents one or more EIF receivers. Use the following
format: where
destination_n is one or more destinations, listed in JSON array format, to which
forwarded events will be sent. |
EIF tab, Assigned EIF Receivers field |
ATOM |
For multiple-row attribute groups, you can enable the situation to continue to test all rows
in the data sampling and open events. Only columns from tables that are specified in the main formula and are eligible for ATOMIZE are processed. For example, the following definition
indicates that only the columns from table REALTHDA that are eligible for
ATOMIZE are processed: Tip: You can use the
GET /system/tables?name=REALTHDA endpoint to
identify columns that are eligible for ATOMIZE, as indicated by "ATOMIZE":
true. |
On Formula tab, select Advanced settings. On Advanced Situation Options window, Display Item tab, Item field. |
COUNT |
Consecutive true samples, which is the number of times the situation remains true before an
event is opened. Use the following
format: where number is
an integer. |
On Formula tab, select Advanced settings. On Advanced Situation Options window, Situation Persistence tab, Consecutive true samples field. |