SendAlert
サーバシステムや監視ソフトウェアなどからアラート情報をAPIで送信できます。
| HTTPメソッド | Action | 名称 |
|---|---|---|
| GET または POST | SendAlert | インシデントAPI |
1: リクエストパラメータ
| パラメータ | タイプ | 必須 | 意味 | 最大文字数 | リクエスト例 | 備考 |
|---|---|---|---|---|---|---|
| ServiceCode | String | ○ | サービスコード | 40 | uom12345678 | ご契約のサービスコードを指定してください |
| NodeName | String | ○ | ノード名 | 1024 | testnode_001 | アラート情報の発生元のサーバシステムを指定してください。アラート通知/対応設定で利用します |
| MonitoringId | String | ○ | 監視ID | 30 | 12345 | アラートの監視項目(監視条件)を一意に特定できるIDを指定してください。アラート通知/対応設定で利用します |
| DetectionMessage | String | ○ | 検知メッセージ | 2048 | Mar 30 01:30:10 testnode_001 root: cron failed. | アラート情報の詳細を指定してください |
| Explanation | String | ○ | 説明 | 2048 | System Error | アラート情報の概要を指定してください |
| ObstacleDetectionTime | String | ○ | 障害検知日時 | 14 | 20150330013010 | YYYYMMDDhhmmss の形式で指定してください |
| Severity | String | ○ | 重要度 | 3 | 1 | 以下から指定してください
|
| MessageId | String | ○ | メッセージID | 36 | msgid00001 | アラートを一意に特定できるIDを指定してください |
| MessageGroup | String | - | メッセージグループ | 2048 | Log Detail | インシデントメッセージのグループを指定してください |
| SurveillanceServer | String | - | 監視サーバ | 40 | surveillance_server | 監視サーバ名を指定してください |
2: レスポンス
| フィールド | タイプ | 意味 | 備考 |
|---|---|---|---|
| ResultCode | String | 実行結果コード | 正常の場合、0を返却します |
3: エラーメッセージ
| エラー | HTTP Status Code | ErrorType | ErrorMessage | 説明 | 備考 |
|---|---|---|---|---|---|
| パラメータエラー | 200 | UOM Parameter Error | UOM parameter error occurred. Uom contract is none. | UOMの契約が存在しない | |
| パラメータエラー | 200 | UOM Parameter Error | UOM parameter error occurred. Monitoring contract is none. | UOMの監視契約が存在しない | |
| パラメータエラー | 200 | UOM Parameter Error | UOM parameter error occurred. Obstacle_detection_time is only number. | 障害検知日時の数値が不正 | 障害検知日時(obstacle_detection_time)は数字のみで構成してください |
| パラメータエラー | 200 | UOM Parameter Error | UOM parameter error occurred. Obstacle_detection_time is digit invalid. | 障害検知日時の桁数が不正 | 障害検知日時(obstacle_detection_time)の桁数は14桁で指定してください |
| パラメータエラー | 200 | UOM Parameter Error | UOM parameter error occurred. Severity is invalid. | 重要度の指定が不正 | 重要度(Severity)は指定のものをご利用ください |
| パラメータエラー | 200 | UOM Parameter Error | Wrong 'obstacle_detection_time' is selected. | 検知日時の指定が不正 | 不正な障害検知日時(obstacle_detection_time)が指定されています |
| パラメータエラー | 200 | UOM Parameter Error | UOM parameter error occurred. Some characters contained in the Monitoring ID are not allowed to enter. The available characters are half-width alpha numeric, hyphen (-), underscore (_) and dot (.). | 監視IDの指定が不正 | 監視IDに半角英数字、ハイフン、アンダーバー、ドット以外の文字が設定されています |
| 例外エラー | 200 | UOM Exception Error | UOM system exception error occurred. | UOM-API設備のシステム障害 |
- 共通エラーについて詳しくは、「UOM-APIのエラー」をご覧ください。
4:警告メッセージ
なし
5:制限
なし
6:サンプル
config.rb
##
## 個別設定
##
# API のキー設定
IIJAPI_ACCESS_KEY = "1234567890ABCDEFGHIJ"
IIJAPI_SECRET_KEY = "1234567890ABCDEFGHIJabcdefghijklmnopqr+1"
##
## API の基本設定
##
# API の ENDPOINT 設定
IIJAPI_ENDPOINT = "https://uom.api.iij.jp"
IIJAPI_SSL_NO_VERIFY = true
# API バージョンの設定
APIVERSION = "20150912"
# Content-Type の設定
CONTENTTYPEVALUE = "application/json; charset=utf-8"
# インシデントAPI
# 以下の内容は、適宜修正してください。
ACTION = "SendAlert"
PARAMS = '{
"ServiceCode" : "uom12345678",
"NodeName" : "testnode_001",
"MonitoringId" : "12345",
"DetectionMessage" : "Mar 30 01:30:10 testnode_001 root: cron failed.",
"Explanation" : "System Error",
"ObstacleDetectionTime" : "20150330013010",
"Severity" : "1",
"MessageId" : "msgid00001"
}'
レスポンス(XML)
<SendAlertResponse> <RequestId>xxxxxxxx-xxxxxxxx-xxxxxxxx-xxxxxxxx-xxxxxxxx</RequestId> <ResultCode>0</ResultCode> </SendAlertResponse>
レスポンス(JSON)
{
"SendAlertResponse": {
"RequestId": "xxxxxxxx-xxxxxxxx-xxxxxxxx-xxxxxxxx-xxxxxxxx",
"ResultCode": "0"
}
}