Creating situations
This example describes how to use the PUT /situations endpoint to create
situations.
- The situation name. Specify a unique name to create a new situation. For more information about the situation name, see Situation name.
- The PDT property specifying the formula for the situation.
You can also specify other optional properties. For more information about the request body properties, see Request body for creating situations.
The format of the request slightly differs depending on if you are creating a single situation or multiple situations in your request, as described in the following sections.
With the PUT /situations endpoint, you can also import multiple existing
situations from one runtime environment into a different runtime environment. Thus, you can
re-create multiple situations in a new runtime environment in a single request. For more information
about importing situations, see Importing multiple situations.
Creating one situation per request
When using the PUT /situations endpoint to create a single situation, include in
the request body the NAME and PDT properties.
https://host:port/api/v1/situations{
"NAME": "Situation_1",
"PDT": "*IF *VALUE Active_Server_Pages.Allocated_Memory *EQ 1",
"DISTRIBUTION": [
"string",
"string"
]
}You can also specify other optional properties. For more information about the request body properties, see Request body for creating situations.
Creating multiple situations in a request
When using the PUT /situations endpoint to create multiple situations, include
in the request body the NAME property and the PDT property
for each situation you want to create.
https://host:port/api/v1/situations[
{
"NAME" : "Situation_1",
"PDT": "*IF *VALUE Active_Server_Pages.Allocated_Memory *EQ 1"
},
{
"NAME" : "Situation_2",
"PDT": "*IF *VALUE Active_Server_Pages.Allocated_Memory *EQ 1",
"FULLNAME": "124 Situation name"
}
]You can also specify other optional properties. For more information about the request body properties, see Request body for creating situations.
Situation name
You must specify a unique name (the NAME property) in the request body to create a new situation.
- NAME
- If the value is 31 characters or less, does not start with a number, and contains only alphanumeric characters or the underscore character, the value is stored as the NAME attribute for the situation.
- FULLNAME
- If any of the following conditions exist, the specified value is stored as the
FULLNAME attribute for the situation:
- The specified value is longer than 31 characters
- The specified value starts with a number
- The specified value contains symbols other than alphanumeric or the underscore character (for example, whitespace characters, question mark, exclamation mark)
Note: Both the NAME attribute value and the FULLNAME attribute value must be unique.
Request body for creating situations
{
"NAME": "string",
"ADVISE": "string",
"AUTOSTART": "string",
"CMD": "string",
"FULLNAME": "string",
"PDT": "string"
"REEV_DAYS": "string",
"REEV_TIME": "string"
"SITINFO": {
"COUNT": "string",
"ATOM": "string",
"TFWD": "string",
"TDST": "string",
"SEV": "string"
},
"TEXT": "string",
"REFLEXACTION_OPTIONS": {
"EACH_ROW" : "string",
"EACH_INTERVAL" : "string",
"WHERE" : "string"
},
"DISTRIBUTION": [
"string"
]
}In addition to the required properties, include only the properties that you want to define. For properties that are not specified, default values are used.
| 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 |
FULLNAME |
The name value of the defined situation when the value does not meet the
NAME criteria. You can specify the FULLNAME attribute together with the NAME attribute. |
Formula tab, Name field |
TEXT |
Situation description. Valid values: character string, max length 64 bytes Default value: none (empty field) |
Formula tab, Description field |
PDT |
Formula containing the thresholds to be tested by the situation. Valid values: character string, max length 1022 characters Note: This parameter is required.
|
Formula tab, Formula fields |
SITINFO |
Situation definitions that are eligible when creating a situation. The
When specifying the 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. These character-string fields accept only integer values. 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. Specify Specify
Valid values:
Default value: |
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 defining the Note:
|
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. Default value: none (empty field) |
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:
Default value: none |
On the Action tab:
|
REFLEXACTION_OPTIONS |
Indicate the reflex action options to take when the situation becomes true. The
When specifying 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 Valid values: Y, N Default value: 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. |
Importing multiple situations
With the PUT /situations endpoint, you can import multiple situations from one
runtime environment into a different runtime environment by completing the following steps:
- In the runtime environment with the existing situations, use the
GET /situationsendpoint to retrieve the situations that you want to import into a different runtime environment. - Copy the response.
- Switch to the runtime environment into which you want to import the situations and select the
PUT /situationsendpoint. - Insert the data for the copied situations into request body, and submit the request.
In the response body, you will find the information for each processed situation.
PUT
/situations request:- If the original runtime environment and the destination runtime environment include nodes
(managed systems) with different names, the situations that are distributed to the nodes that do not
exist in the destination runtime environment will not be created. This scenario also applies to
correlated situations that have node names in the formula.
To avoid this scenario, update the node names in
DISTRIBUTIONor inPDT(for correlated situations) accordingly. - If you have custom managed system groups in the original runtime environment and want to keep them in the destination runtime environment, you should either create them in the destination runtime environment or rename them accordingly.
- If the situations that you want to import include correlated or embedded situations in them,
mind the order of the situations in request body; so that the situations that are included in
embedded or correlated situations are defined before the situations that include them. For example, the correlated situation with the name
SituationThatMonitorsincludesSituationToMonitor1andSituationToMonitor2. In request body,SituationToMonitor1andSituationToMonitor2should be placed beforeSituationThatMonitors, as shown in the following example:[ { "NAME" : "SituationToMonitor1", "PDT": "*IF *VALUE Active_Server_Pages.Allocated_Memory *EQ 1", "FULLNAME": "123 Situation name 1" }, { "NAME" : "SituationToMonitor2", "PDT": "*IF *VALUE Active_Server_Pages.Allocated_Memory *EQ 1", "FULLNAME": "124 Situation name 2" }, { "NAME" : "SituationThatMonitors", "PDT": "*IF *VALUE *HSITNAME *EQ SituationToMonitor1 *AND *VALUE *HNODE *EQ PLEXA:SYSTEM1:MVSSYS *AND *VALUE *HDELTASTAT *EQ Y *AND *VALUE *HSITNAME *EQ SituationToMonitor2 *AND *VALUE *HNODE *EQ PLEXA:SYSTEM2:MVSSYS *AND *VALUE *HDELTASTAT *EQ Y", "FULLNAME": "124 Situation name 2" } ]