Events API

ビジネスアプリケーションのすべての正常性ルール違反を取得する

このページでは、イベントを作成、管理、およびモニターするために使用できる、イベント API メソッドについて説明します。

指定したタイムフレーム内にアプリケーションで発生したすべての正常性ルールに対する違反を返します。

URI

/controller/rest/applications/application_id/problems/healthrule-violations

入力パラメータ

パラメータ名 Parameter Type 必須

application_id

URI

アプリケーション名またはアプリケーション ID のいずれかを指定します。

あり

time-range-type

クエリ

可能な値は以下の通りです:

BEFORE_NOW BEFORE_NOW" duration-in-mins"" オプションを使用するには、" および " パラメータも指定する必要があります。BEFORE_TIMEBEFORE_TIME"duration-in-mins""end-time" オプションを使用するには、" および " パラメータも指定する必要があります。AFTER_TIMEAFTER_TIME" duration-in-mins""start-time" オプションを使用するには、" および " パラメータも指定する必要があります。

BETWEEN_TIMES

このオプションを使用するには、"start-time" および "end-time" パラメータも指定する必要があります。"BETWEEN_TIMES" の範囲には start-time が含まれますが、end-time は除外されます。

あり

duration-in-mins

クエリ

メトリックデータを返す期間(分単位)。

time-range-type が BEFORE_NOW, BEFORE_TIME, または AFTER_TIME の場合

start-time

クエリ

メトリックデータが返される期間の開始時刻(ミリ秒単位)。

time-range-type が AFTER_TIME または BETWEEN_TIMES の場合

end-time

クエリ

メトリックデータが返される期間の終了時刻(ミリ秒単位)。

time-range-type が BEFORE_TIME または BETWEEN_TIMES の場合

output

クエリ

出力形式を変更するために URL の一部として含まれている HTTP リクエストパラメータ。有効な値は XML(デフォルト)または JSON です。

いいえ

CODE
http://demo.appdynamics.com/controller/rest/applications/7/problems/healthrule-violations?time-range-type=BEFORE_NOW&duration-in-mins=15
                    <policy-violations><policy-violation> <id>266</id>
                    <name>CPU utilization is too high</name>
                    <startTimeInMillis>1452630655000</startTimeInMillis>
                    <detectedTimeInMillis>0</detectedTimeInMillis>
                    <endTimeInMillis>1452630715000</endTimeInMillis>
                    <incidentStatus>RESOLVED</incidentStatus>
                    <severity>WARNING</severity> <triggeredEntityDefinition>
                    <entityType>POLICY</entityType> <entityId>30</entityId>
                    <name>CPU utilization is too high</name>
                    </triggeredEntityDefinition> <affectedEntityDefinition>
                    <entityType>APPLICATION_COMPONENT_NODE</entityType>
                    <entityId>16</entityId> <name>Fulfillment</name>
                    </affectedEntityDefinition>
                    <deepLinkUrl>http://demo.appdynamics.com/controller/#location=APP_INCIDENT_DETAIL&incident=266</deepLinkUrl>
                    <description>AppDynamics has detected a
                    problem.<br><b>errorAbhi</b> is violating.
                    </description> </policy-violation> <policy-violation>
                    <id>268</id> <name>CPU utilization is too high</name>
                    <startTimeInMillis>1452630655000</startTimeInMillis>
                    <detectedTimeInMillis>0</detectedTimeInMillis>
                    <endTimeInMillis>1452630715000</endTimeInMillis>
                    <incidentStatus>RESOLVED</incidentStatus>
                    <severity>WARNING</severity> <triggeredEntityDefinition>
                    <entityType>POLICY</entityType> <entityId>30</entityId>
                    <name>CPU utilization is too high</name>
                    </triggeredEntityDefinition> <affectedEntityDefinition>
                    <entityType>APPLICATION_COMPONENT_NODE</entityType>
                    <entityId>20</entityId> <name>FulfillmentClient</name>
                    </affectedEntityDefinition>
                    <deepLinkUrl>http://demo.appdynamics.com/controller/#location=APP_INCIDENT_DETAIL&incident=268</deepLinkUrl>
                    <description>AppDynamics has detected a problem with Node
                    <b>FulfillmentClient</b>.<br><b>CPU
                    utilization is too high</b> started violating and is now
                    <b>warning</b>.<br>All of the
                    following conditions were found to be violating<br>For Node
                    <b>FulfillmentClient</b>:<br>1)
                    Hardware Resources|CPU|%Busy
                    Condition<br><b>%Busy's</b> value
                    <b>76.0</b> was <b>greater
                    than</b> the threshold <b>75.0</b> for
                    the last <b>30</b>
                    minutes<br></description> </policy-violation>
                    </policy-violations>

Retrieve Event Data

You can capture data for the event types listed in the eventtypes parameter.

URI /controller/rest/applications/application_id/events

Input Parameters

Parameter Name Parameter Type Value Mandatory

application_id

URI

Provides either the application name or application id.

Yes

summary Query Provides the summary for the event. Yes
comment Query Provides the comments (if any) for the event. No
eventtype Query APPLICATION_DEVELOPMENT Yes

time-range-type

Query

Possible values are:

BEFORE_NOW To use the "BEFORE_NOW" option, you must also specify the "duration-in-mins" parameter.BEFORE_TIME To use the "BEFORE_TIME" option, you must also specify the "duration-in-mins" and "end-time" parameters.AFTER_TIMETo use the "AFTER_TIME" option, you must also specify the "duration-in-mins" and "start-time" parameters.

BETWEEN_TIMES

To use this option, you must also specify the "start-time" and "end-time" parameters. The "BETWEEN_TIMES" range includes the start-time and excludes the end-time.

Yes

duration-in-mins

Query

Specify the duration (in minutes) to return the metric data.

If time-range-type is BEFORE_NOW, BEFORE_TIME, or AFTER_TIME

start-time

Query

Specify the start time (in milliseconds) from which the metric data is returned.

If ttime-range-type is AFTER_TIME or BETWEEN_TIMES

end-time

Query

Specify the end time (in milliseconds) until which the metric data is returned.

If time-range-type is BEFORE_TIME or BETWEEN_TIMES

event-types

Query

Specify the comma-separated list of event types for which you want to retrieve event information. See Events Reference.

Yes

severity

Query

Provides the severity level. Specify the comma-separated list of severities for which you want to retrieve event information. Allowed values are:

  • INFO
  • WARN
  • ERROR

In the UI these values become Info, Warning, and Critical.

Yes

output

Query

HTTP Request parameter included as part of the URL to change the output format. Valid values are XML (default) or JSON.

No

tier Query Name of the tier in the application No
注: This API can retrieve 600 events at a time.

Example

Retrieve the list of events of type APPLICATION_ERROR or DIAGNOSTIC_SESSION of any severity that occurred in the specified time range:

CODE
curl --user user1@customer1:your_password http: //demo.appdynamics.com//controller/rest/applications/6/events?time-range-type=BEFORE_NOW\&duration-in-mins=30\&event-types=%20APPLICATION_ERROR,DIAGNOSTIC_SESSION\&severities=INFO,WARN,ERROR
<events><event>
<id>44658</id>
<type>DIAGNOSTIC_SESSION</type>
<subType>ERROR_DIAGNOSTIC_SESSION</subType>
<eventTime>1451343453085</eventTime>
<severity>WARN</severity>
<summary>Starting Diagnostic Session after series of errors for a Business Transaction 18% (2/11) of requests had errors in the last minute starting 12/28/15 10: 57 PM local time</summary>
<affectedEntities>
<entity-definition>
<entityType>APPLICATION</entityType>
<entityId>6</entityId>
<name>ECommerce</name>
</entity-definition>
<entity-definition>
<entityType>APPLICATION_COMPONENT</entityType>
<entityId>11</entityId>
<name>ECommerce-Services</name>
</entity-definition>
<entity-definition>
<entityType>APPLICATION_COMPONENT_NODE</entityType>
<entityId>19</entityId>
<name>ECommerce_WEB2</name>
</entity-definition>
<entity-definition>
<entityType>BUSINESS_TRANSACTION</entityType>
<entityId>35</entityId>
<name>/items/all.GET</name>
</entity-definition>
<entity-definition>
<entityType>MACHINE_INSTANCE</entityType>
<entityId>8</entityId>
<name>ECommerce-web1</name>
</entity-definition>
</affectedEntities>
<triggeredEntity>
<entityType>APPLICATION_COMPONENT_NODE</entityType>
<entityId>19</entityId>
<name>ECommerce_WEB2</name>
</triggeredEntity>
<markedAsRead>false</markedAsRead>
<markedAsResolved>false</markedAsResolved>
<archived>false</archived>
<deepLinkUrl>http: //demo.appdynamics.com:8090/controller/#location=APP_EVENT_VIEWER_MODAL&amp;eventSummary=44658</deepLinkUrl>
</event>
</events>

イベントの作成

アプリケーション展開イベントは、アプリケーションをアップグレードするときや新しいコードをプッシュするときなどに、Splunk AppDynamics に通知を行います。これにより、これらのアプリケーション展開アクティビティを Splunk AppDynamics 内の他のデータと関連付けることができます。これは、回帰分析、根本原因分析、およびパフォーマンスの調査を行う際に役立ちます。アプリケーションの新バージョンを展開するためのビルドプロセスの一環として、アプリケーション展開イベントを Splunk AppDynamics に組み込むと便利です。

Splunk AppDynamics REST API を使用すると、APPLICATION_DEPLOYMENT タイプのイベントと他のシステムを統合できます。

たとえば、新しいリリースごとに Splunk AppDynamics の監視対象システムでイベントを自動的に作成するには、これらのシステムを統合し、次の REST API を使用して、管理対象環境でタイプ "APPLICATION_DEPLOYMENT" のイベントを作成します。

要求が正常に呼び出された後で、イベント ID を受信する必要があります。

ロールと権限

重要: 800pxINLINEイベントを作成するには、Create Events 権限が必要です。「」「アプリケーションの権限」を参照してください。

URI

POST /controller/rest/applications/application_id/events

入力パラメータ

パラメータ名 Parameter Type 必須

application_id

URI

アプリケーション名またはアプリケーション ID のいずれかを指定します。

あり

summary

[Query(クエリ)]

イベントを説明する概要を指定します。

あり

コメント

[Query(クエリ)]

イベントのコメント(存在する場合)を入力します。

いいえ

eventtype

クエリ

APPLICATION_DEPLOYMENT

あり

重大度 [Query(クエリ)] 重大度レベルを指定します。許容値は次のとおりです:
  • "INFO"
  • "WARN"
  • "ERROR"

UI では、これらは "Info", "Warning"、および "Critical" になります。

あり

カスタムイベントの作成

Splunk AppDynamics イベントビューアおよび Splunk AppDynamics ダッシュボードのイベントパネルでレポートされるカスタムイベントを作成できます。カスタムイベントをフィルタ処理する方法については、「イベントのモニタリング」を参照してください。次に、Splunk AppDynamics 標準イベントの場合と同じように、これらのイベントによってトリガーされるアラートを作成できます。

要求が正常に呼び出された後で、イベント ID を受信する必要があります。

ロールと権限

重要: 800pxINLINEカスタムイベントを作成するには、Create Events 権限が必要です。「アプリケーションの権限」を参照してください。

URI

POST /controller/rest/applications/application_id/events

入力パラメータ

パラメータ名 Parameter Type 必須

application_id

URI

アプリケーション名またはアプリケーション ID のいずれかを指定します。

あり

summary

[Query(クエリ)]

イベントを説明する概要を指定します。

あり

コメント

[Query(クエリ)]

イベントのコメントを指定します。

いいえ

重大度 [Query(クエリ)]

重大度レベルを指定します。許容値は次のとおりです:

  • "INFO"
  • "WARN"
  • "ERROR"

UI では、これらは "Info", "Warning"、および "Critical" になります。

あり

eventtype

クエリ

カスタム

あり

customeventtype クエリ "type". に名前を指定します。たとえば、"nagios". のようなソースを指定します。 いいえ
node [Query(クエリ)] 影響を受けるノード名を指定します。 いいえ
tier [Query(クエリ)] 影響を受ける階層名を指定します。 はい(nodebt が指定されている場合)
bt [Query(クエリ)] 影響を受けるビジネストランザクション名を指定します。 いいえ
propertynames クエリ プロパティ名をペアとして指定します(例:"key".)。 なし。ただし、ペアの 1 つの要素が定義されている場合は、もう一方の要素も定義する必要があります。
propertyvalues クエリ プロパティ値をペアとして指定します(value")。値は 5000 文字に制限されています。

なし。ただし、ペアの 1 つの要素が定義されている場合は、もう一方の要素も定義する必要があります。

CODE
curl -X POST --user user1@customer1:your_password 'http://demo.appdynamics.com/controller/rest/applications/5/events?severity=INFO&summary=test1&eventtype=CUSTOM&customeventtype=mycustomevent&propertynames=key1&propertynames=key2&propertyvalues=value1&propertyvalues=value'
警告: カスタムプロパティのパターンに注意してください。propertynamespropertyvalues は配置が一致するため、N 個のプロパティ値を設定するには、propertynames を N 回、propertyvalues を N 回出現させる必要があります。

通知用のカスタム URL の作成

マルチテナント コントローラ インスタンス内の単一テナントは、この API メソッドを使用して、通知用にカスタム URL またはバニティ URL を指定する必要があります。paid8.appdynamics.com などの URL をホストとして表示するのではなく、カスタム URL を通知内で yourcompany.appdynamics.com のように表示することができます。

URI

POST /controller/rest/accounts/customer_name/update-controller-url

入力パラメータ

パラメータ名 Parameter Type 必須
customer_name URI カスタマーアカウント名 あり

本文パラメータ

アプリケーション/JSON コンテンツとして:

JSON
{
"controllerURL": "http://<my-custom-hostname:port>"
}
注:

アラートの URL が無効な場合は、次の curl コマンドを使用して設定できます。

JSON
curl -k --basic --user root@system --header "Content-Type: application/json" --data '{ "controllerURL": "http://<controller>:<port>" }' http://<controller>:<port>/controller/rest/accounts/<ACCOUNT-NAME>/update-controller-url
JSON
curl -k --basic --user root@system --header "Content-Type: application/json" --data '{ "controllerURL": "http://<controller>:<port>" }' http://<controller>:<port>/controller/rest/accounts/<ACCOUNT-NAME>/update-controller-url

例:

JSON
curl -k --basic --user root@system --header "Content-Type: application/json" --data '{ "controllerURL": "https://myVIP:443" }' https://myhost:8181/controller/rest/accounts/customer1/update-controller-url

コントローラをアップグレードするとディープリンク URL の設定がリセットされるため、コントローラをリセットする必要はありません。