Contrail アラート
Contrail 3.0 以降、Contrail アラートはユーザーごとの可視エンティティ(UVE)ベースで提供されます。
Contrail分析では、UVE の内容とオブジェクトの設定を調べる Python コードルールを使用して、アラートを生成またはクリアします。いくつかのルールが組み込まれています。その他は、Python の港湾 作業プラグインを使用して追加できます。
このトピックでは、Contrail のアラート機能について説明します。
アラート API の形式
Contrail アラート分析 API には以下が提供されます。
UVE GET API の一部としてのアラートへの読み取りアクセス。
POST 要求を使用したアラート受信確認。
サーバー送信イベント (SSE) を使用した UVE とアラートのストリーミング。
例えば:
GET http://<analytics-ip>:8081/analytics/uves/control-node/a6s40?flat
{ NodeStatus: {…}, ControlCpuState: {…}, UVEAlarms: { alarms: [ { description: [ { value: "0 != 2", rule: "BgpRouterState.num_up_bgp_peer != BgpRouterState.num_bgp_peer" } ], ack: false, timestamp: 1442995349253178, token: "eyJ0aW1lc3RhbXAiOiAxNDQyOTk1MzQ5MjUzMTc4LCAiaHR0cF9wb3J0Ijog NTk5NSwgImhvc3RfaXAiOiAiMTAuODQuMTMuNDAifQ==", type: "BgpConnectivity", severity: 4 } ] }, BgpRouterState: {…} }
この例では、次のようになります。
アラートは UVE ごとに発生し、UVE の GET によって取得できます。
An
ack
は、アラートが確認されたかどうかを示します。A
token
は、受信確認を要求するときにクライアントによって使用されます
アラートの分析 API
次の例は、アラートとアラームを表示し、アラームを確認するために使用する API を示しています。
という名前の
aXXsYY
制御ノードに対して発生したアラートのリストを取得します。GET http://<analytics-ip>:<rest-api-port>/analytics/uves/control-node/aXXsYY&cfilt=UVEAlarms
これは、すべての UVE テーブル型で使用できます。
システム内のすべてのアラームのリストを取得します。
GET http://<analytics-ip>:<rest-api-port>/analytics/alarms
アラームを確認します。
POST http://<analytics-ip>:<rest-api-port>/analytics/alarms/acknowledge Body: {“table”: <object-type>,“name”: <key>, “type”: <alarm type>, “token”: <token>}
確認済みおよび未確認のアラームは、次の URL クエリパラメータと前述の GET 操作を使用して具体的に照会できます。
ackFilt=True ackFilt=False
SSE ストリーミング用の分析 API
次の例は、SE ストリームのすべてまたは一部を取得するために使用する API を示しています。
制御ノードアラームの UVE アップデートの SSE ベースのストリームを取得します。
GET http://<analytics-ip>:<rest-api-port>/analytics/uve-stream?tablefilt=control-node
これは、すべての UVE テーブル型で使用できます。
tablefilt
URL クエリ パラメーターを指定しない場合は、すべての UVE が取得されます。コンテンツ全体ではなく、UVE 更新の SSE ベースのストリームのアラート部分のみを取得します。
GET http://<analytics-ip>:<rest-api-port>/analytics/alarm-stream?tablefilt=control-node
これは、すべての UVE テーブル型で使用できます。
tablefilt
URL クエリ パラメーターを指定しない場合は、すべての UVE が取得されます。
組み込みのノードアラート
次の組み込みノード アラートは、「 アラートの分析 API」に記載されている API を使用して取得できます。
control‐node: { PartialSysinfoControl: "Basic System Information is absent for this node in BgpRouterState.build_info", ProcessStatus: "NodeMgr reports abnormal status for process(es) in NodeStatus.process_info", XmppConnectivity: "Not enough XMPP peers are up in BgpRouterState.num_up_bgp_peer", BgpConnectivity: "Not enough BGP peers are up in BgpRouterState.num_up_bgp_peer", AddressMismatch: “Mismatch between configured IP Address and operational IP Address", ProcessConnectivity: "Process(es) are reporting non‐functional components in NodeStatus.process_status" }, vrouter: { PartialSysinfoCompute: "Basic System Information is absent for this node in VrouterAgent.build_info", ProcessStatus: "NodeMgr reports abnormal status for process(es) in NodeStatus.process_info", ProcessConnectivity: "Process(es) are reporting non‐functional components in NodeStatus.process_status", VrouterInterface: "VrouterAgent has interfaces in error state in VrouterAgent.error_intf_list”, VrouterConfigAbsent: “Vrouter is not present in Configuration”, }, config‐node: { PartialSysinfoConfig: "Basic System Information is absent for this node in ModuleCpuState.build_info", ProcessStatus: "NodeMgr reports abnormal status for process(es) in NodeStatus.process_info", ProcessConnectivity: "Process(es) are reporting non‐functional components in NodeStatus.process_status" }, analytics‐node: { ProcessStatus: "NodeMgr reports abnormal status for process(es) in NodeStatus.process_info" PartialSysinfoAnalytics: "Basic System Information is absent for this node in CollectorState.build_info", ProcessConnectivity: "Process(es) are reporting non‐functional components in NodeStatus.process_status" }, database‐node: { ProcessStatus: "NodeMgr reports abnormal status for process(es) in NodeStatus.process_info", ProcessConnectivity: "Process(es) are reporting non‐functional components in NodeStatus.process_status" },