EVENT STATUS Request | Application Programming Reference | Teradata Vantage - EVENT STATUS - Advanced SQL Engine - Teradata Database

Application Programming Reference

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-22
dita:mapPath
cpn1571792172880.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1090
lifecycle
previous
Product Category
Teradata Vantage™

Purpose

Returns information about the current status of all event-related constructs, such as events through states, and information related to the current state.

Input Data

Element Data Type Description
IndByte BYTE Indicator bits that specify which fields to treat as NULL if you are using indicator mode.

Each bit in the byte corresponds to one field in the input data.

If data is supplied for that field, set the bit to zero.

If the data for that field is NULL (that is, there is no data supplied for that field), set the bit to 1.

The IndByte field is only required if the CLIv2 request is submitted in indicator mode.
mon_ver_id SMALLINT, NOT NULL MONITOR software version ID. This can be version 6 or later.

For a general explanation of monitor version choices, see MONITOR VERSION.

Request Type SMALLINT, NOT NULL 1 = ALL. This option returns the status of all events, expressions, SysCons, and OpEnvs defined in the Teradata Viewpoint Workload Designer portlet.

2 = CURRENT. This option includes the status of those events and expressions that are related to the currently enforced health condition (SysCon) and planned environment (OpEnv).

ID Mapping SMALLINT Mapping information returned in the output, such as the names and IDs defined within the current rule set.

If a value of 1 is returned, mapping record types are included. Otherwise, no mapping information is returned.

Monitor Privileges

To use this request, you must have the ABORTSESSION and MONSESSION privileges as part of your default role or both privileges must be granted directly to you.

For more information on roles and privileges, see:

CLIv2 Response Parcels

The following table lists information about the parcels.

Parcel Sequence Flavor Field Length Comments and Key Parcel Body Fields
Success 8 18 to 273 StatementNo =1

ActivityCount = Not applicable

ActivityType = 170 (PCLEVENTSTATUSSTMT)

DataInfo 71 6 to 64100 Optional: this parcel is present if request was IndicData parcel.
Record 10
  • 5 to 64100 (record mode)
  • 6 to 64100 (indicator mode)
Depending on the request (Data or IndicData) data is returned in record or indicator mode. This is the only record returned.

This record contains an indicator for each category indicating its status after processing this request (0=active, 1=inactive)

EndStatement 11 6 StatementNo = 2-byte integer
EndRequest 12 4 None

For an example of how the PM/API request, built in Java, appears when sent to the database server, see Teradata JDBC Driver Reference, available at https://teradata-docs.s3.amazonaws.com/doc/connectivity/jdbc/reference/current/frameset.html .

Response

Each of the statement types described below correspond to a ResultSet returned by the Teradata JDBC Driver, and each statement type field corresponds to a ResultSet column. For more information on ResultSets, see Teradata JDBC Driver Reference, available at https://teradata-docs.s3.amazonaws.com/doc/connectivity/jdbc/reference/current/frameset.html .

The EVENT STATUS request returns the status of all items that make up either the CURRENT or ALL states defined in the current rule set.

The output is divided into three statements:
  • The first statement provides configuration overview information.
  • The second statement provides a series of records that represent the status of events, expressions and states in the system. Only events that are referenced in Expressions that have an action are included in this statement. To optimize the interface, this information is provided using the internal ID of the various events, expressions and states.
  • The third statement, which is optional, provides the mapping of internal IDs to names.

Statement 1

The first statement returns information about the current configuration.

Field/Column Name Data Type Description
Config ID INTEGER

NOT NULL

Configuration ID of the current rule set.
Config Name VARCHAR (30) Name of the current rule set, blank filled.
Date DATE Date when this configuration was first activated.
Time FLOAT Time when this configuration was first activated.

Use this first statement to determine if a new configuration has been placed into effect. When a new configuration is placed into effect, the mapping record type should be requested to provide the mapping of object IDs to object names.

Statement 2

The second statement returns a series of records that provide the status of events, expressions, SysCons and OpEnvs in the system. The information returned shows the relationship between an Event, the Expression that references that Event, and the SysCon or OpEnv that is affected by that Expression.

There is one record returned for every Event that is referenced in the associated Expression. When CURRENT is requested only a single Expression for the CURRENT SysCon and OpEnv that caused that SysCon or OpEnv to be defined as enforced is returned. When ALL is requested, ALL expressions for each SysCon or OpEnv are returned. In addition, the ALL interface returns those expressions which do not have an action related to a SysCon or OpEnv. These are referred to as Notify Only Expressions.

The expression and owning SysCon or OpEnv ID fields are repeated until all events are included. If events are repeated within multiple expressions, those events are reported within each of those expressions. For the case of the ALWAYS OpEnv and the NORMAL SysCon, there is no expression associated. Statements for these two items have a value of zero for the Event and Expression ID fields.

Field/Column Name Data Type Description
EventId INTEGER

NOT NULL

Internal ID of the Event. A value of zero indicates there is no event for this record entry. There are no expressions for the Normal SysCon, Always OpEnv, and a State.

Events are reported in the order they appear within the associated expression. Only events in the associated expression are included.

EventStatus SMALLINT Status of the event:
  • 0 = Inactive
  • 1 = Active
EventActiveDate DATE Date when EventStatus was last changed. This is the date when EventStatus was set to Inactive or Active.
Event Active Time FLOAT Time when EventStatus was last changed. This is the time when EventStatus was set to Inactive or Active.
ExpressionId INTEGER

NOT NULL

Internal ID of the Expression.

A value of zero indicates there is no expression for this record entry. There are no expressions for the Normal SysCon, Always OpEnv, and a State.

For the CURRENT state request, the first TRUE expression for the associated State is included. When there are multiple true expressions for a state only the first one processed is reported. The order of processing is consistent within a rule set and, therefore, the same True expression is reported on every request.

Expression Status SMALLINT Current status of the Expression:
  • 0 = Inactive
  • 1 = Active
Expression Active Date DATE Date when Expression Status was last changed. This is the date when Expression Status was set Active or Inactive.
Expression Active Time FLOAT Time Expression Status was last changed. This is the time when Expression Status was set Active or Inactive.
Record Type SMALLINT Type of information contained in this record:
  • 0 = SysCon
  • 1 = OpEnv
  • 2 = Notify Only Expression. This option indicates the remaining fields are not applicable as only the Event or Expression relationship is reported in this statement.
  • 3 = State. This option indicates the current active State. This is the result of the current SysCon and OpEnv. For this Record Type, the Event and Expression fields above are not valid.
For both the CURRENT and ALL requests, the order in which State information is returned is as follows:
  • SysCon
  • OpEnv
  • State (Returns only the Enforced State)
Notify Only Expression is only returned for the ALL request.
Id INTEGER

NOT NULL

Internal ID of either a SysCon or an OpEnv depending on the Record Type specified.

The value is zero for Notify Only Expression record types. Notify Only Expression records represent Expressions that do not have an action to activate a Syscon or OpEnv. These Expressions are not associated with a State.

Status SMALLINT Current status of the Syscon or OpEnv:
  • 0 = Inactive
  • 1 = Active
  • 2 = Active and Enforced
Due To Duration INTEGER Indicator that the corresponding SysCon is being considered as TRUE or is TRUE:
  • 1 = SysCon is Active if the corresponding SysCon is being considered as TRUE due to minimum duration (MinDuration) value being in affect.
  • 0 = SysCon is Inactive if the Syscon is TRUE based on the defined expressions.
This field is valid only when SysCon is the Record Type specified.
Active Date DATE Date when the status of the Record Type was last changed. This is the date when the SysCon or OpEnv Status was set Active or Inactive.
Active Time FLOAT Time representing when the status of the Record Type was last changed. This is the time when the SysCon or OpEnv Status was set Active or Inactive.

The date or time for each item (for example, Event, Expression, or State) shows when the status that is represented occurred.

The “State” column in the examples below refers to the “Expression Status” field.
EvtID Status Date/Time      ExpID State    Date/Time         RecType   Id   Status
110    1     8:00AM 1/2/06  220     1      8:00AM 1/2/06      0       300   1
120    0     8:15AM 1/2/06  220     1      8:15AM 1/2/06      0       300   1
130    1     8:00AM 1/2/06  320     1      8:00AM 1/2/06      1       400   1
140    1     8:15AM 1/2/06  320     1      8:15AM 1/2/06      1       400   1

This statement shows two records representing a Single expression (220) that is defined with two Events (110 and 120). In this example, 110 is true and 120 is false. The original expression must be referenced by the user to determine why these event values resulted in the Expression being true. That is, these events are part of a logical expression whose structure is not being reported here. Another expression (320) is shown that is made up of two events (130 and 140). This expression is responsible for the OpEnv of 400 being in enforced.

EvtID   Status  Date/Time     ExpID  State  Date/Time       RecType  Id   Status
0        0      8:00AM 1/2/06   0      0    8:00AM 1/2/06      0     100   1
0        0      8:15AM 1/2/06   0      0    8:15AM 1/2/06      1     200   1

This record has both event and expression IDs of zero. This is the case for both the NORMAL SysCon and the ALWAYS OpEnv which have no expressions associated with them. The Date/Time fields are not valid since they are not associated with an Event or Expression but are only shown as placeholders.

For the CURRENT request, the first Active expression for a SysCon/OpEnv is returned. Within this Active (true) expression, all events, both Active and Inactive, are reported. The interface reports the events in a consistent order for a given expression.

For the ALL request, the order of reporting is that all SysCons are returned, followed by all OpEnvs, then all Expressions not associated with a SysCon or OpEnv State. These are referred to as Notify Only Expressions. Within a SysCon or OpEnv, all expressions for that State are reported before reporting the next SysCon or OpEnv. There is no order defined for the expressions reported under a SysCon/OpEnv but the interface ensures that expressions are returned in a consistent order.

The following example shows the reporting of three SysCons (300, 310 and 400), three OpEnvs (500, 530, and 540), and one Notify Only Expression (329) made up of one event (199). This Notify Only Expression does not have an ID for the Record Type (2). Although not shown in the example, only one SysCon and one OpEnv reported have the enforced value returned (a Status of 2). You must independently use the TDWM database State table to make the association to a State using the returned SysCon and OpEnv.

The “State” column in the example below refers to the “Expression Status” field.
EvtID   Status  Date/Time     ExpID   State    Date/Time       RecType    Id   Status
110      1    8:00AM 1/2/06  220      0      8:00AM 1/2/06      0       300    0
120      0    8:15AM 1/2/06  220      1      8:15AM 1/2/06      0       310    1
130      1    8:00AM 1/2/06  223      1      8:00AM 1/2/06      0       400    1
140      1    8:15AM 1/2/06  223      1      8:15AM 1/2/06      0       400    1
150      1    8:00AM 1/2/06  244      0      8:00AM 1/2/06      1       500    1
160      0    8:15AM 1/2/06  220      1      8:15AM 1/2/06      1       500    1
170      1    8:00AM 1/2/06  320      1      8:00AM 1/2/06      1       540    1
180      1    8:15AM 1/2/06  320      1      8:15AM 1/2/06      1       530    1
199      1    8:15AM 1/2/06  329      1      8:15AM 1/2/06      2        0     0

Statement 3

The third statement, if requested, provides a fully enumerated list of all objects that make up the system state. Some of these objects may not be represented in any expressions in the state definition. There are no duplications of objects in this statement and there is no correlation made between objects.

Since this information does not change frequently this mapping information only needs to be requested when a new configuration is made active by the administrator.

Field/Column Name Data Type Description
Object Type SMALLINT Type of object:
  • 0 = Event
  • 1 = Expression
  • 2 = SysCon
  • 3 = OpEnv
  • 4 = State
Object Id INTEGER, NOT NULL Internal object ID for the object type.
Object Name VARCHAR (30) Name of the object.
Object Status SMALLINT Current status of the object:
  • 0 = Inactive
  • 1 = Active
Precedence/Severity INTEGER Indicator of the Precedence or Severity of the SysCon or OpEnv object types only:
  • SysCon = Indicates the Severity of the SysCon.
  • OpEnv = Indicates the Precedence of the OpEnv.
This field does not apply if this is an Event.
Date DATE Date of the current object status (see Object Status).
Time FLOAT Time of the current object status (see Object Status).
EventKind INTEGER Indicator of the specific event:
  • 1 = User Defined SysCon. The user-defined system condition.
  • 2 = User Defined OpEnv. The user-defined operating environment.
  • 3 = Time Period. The time range.
  • 4= Fatal AMPs. The number of AMPs with the status of FATAL.
  • 5 = Fatal PEs. The number of PEs with the status of FATAL.
  • 6 = Fatal GTWs. The number of Gateways with the status of FATAL.
  • 7 = Nodes Down. The % of nodes down within a clique.
  • 8 = Minimum available AWTs. The number of in-use AMP AWTs.
  • 9 = AMPs In Flow Control. The number of AMPs in flow control.
  • 10 = Average System CPU. This value is calculated by the CPU usage columns in the ResUsageSpma and ResUsageSps tables and compared to the threshold defined by the user in this event. See Teradata Vantage™ - Resource Usage Macros and Tables, B035-1099 for information.
  • 11 = System CPU Skew. This value is calculated by the CPU usage columns in the ResUsageSpma and ResUsageSps tables. For more information, see Teradata Vantage™ - Resource Usage Macros and Tables, B035-1099.
  • 12 = WD CPU %. This value is calculated by the CPU usage columns in the ResUsageSpma and ResUsageSps tables. For more information, see Teradata Vantage™ - Resource Usage Macros and Tables, B035-1099.
  • 13 = WD SLG Response Time. The % of request in this WD that have met the defined Response Time SLG.
  • 14 = WD SLG Throughput. The % of request in this WD that have met the defined Throughput SLG.
  • 15 = WD Arrivals. The number of new requests for this WD.
  • 16 = WD Active Request. The number of currently active requests in this WD.
  • 17 = WD Delay Queue Depth. The number of requests on the Delay Queue for this WD.
  • 18 = WD Delay Query Time. The max time a request has been delayed in this WD.
  • 19 = WD AWT Wait Time. The max time a request from this WD was on an AMP mailbox waiting for an AWT.
  • 20 = TwmFlexAvailableAWTsEvent. The number of AWTs that are available for work.
  • 21 = TwmFlexAvgCpuEvent. This value is calculated by the CPU usage columns in the ResUsageSpma and ResUsageSps tables and compared to the threshold defined by the user in this event. For more information, see Teradata Vantage™ - Resource Usage Macros and Tables, B035-1099.
EventClass INTEGER This field is only valid for Object Type of Event and Expression. The values are:
  • 1 = OpEnv
  • 2 = SysCon
  • 3 = FlexThrtl

The following example shows the relationship between the Event Id (110) in statement 2 and the Object Name (AMPDownEvent) in statement 3.

The data returned looks similar to this:

Object type = 0
Object Id    = 110
Object name =  AMPDownEvent
Object status = 0
Precedence/Severity=
Date = 04/04/07
Time = 02:30:06
EventKind = 9

The following is the order of objects returned for statement 3:

  1. All the rows for the Events
  2. A row for a SysCon and all Expressions that are part of that Syscon
  3. A row for the next SysCon and its subordinate Expressions until all SysCons are reported
  4. A row for a OpEnv and all Expressions that are part of that OpEnv
  5. A row for the next OpEnv and its subordinate Expressions until all OpEnvs are reported
  6. All the rows for the States
  7. All the rows for the Notify Only Expressions