Download PDF
Download page ServiceNow との統合.
ServiceNow との統合
ServiceNow® は、IT サービスを管理するためのインシデント管理ツールです。IT インフラストラクチャはさまざまなアプリケーションに分散する可能性があり、IT インシデントをグループ化または関連付けることが困難になります。したがって、IT の問題における平均検出時間(MTTD)と平均解決時間(MTTR)は増加することになります。Cisco AIOps では ServiceNow インスタンスを統合して、IT インシデント、問題、および変更要求をエンドツーエンドで可視化します。この統合には、Cisco AIOps と ServiceNow インスタンスの変更が必要です。
この統合により、IT サービスが取得され、インシデント、問題、および変更と関連付けられます。Cisco AIOps は、ServiceNow で定義した IT サービスカテゴリを使用して IT インシデントをモニターするためのコンテキストベースのビューを提供します。IT サービスのカテゴリには、組織、製品、サービス、およびポートフォリオがあります。
前提条件
次のものがあることを確認してください。
- ServiceNow インスタンスの管理者権限。
- ServiceNow ユーザーアカウント。
- Cisco Observability Platform テナントの OAuth 2.0 トークン。OAuth トークンを生成するには、「サービスプリンシパルの作成」を参照してください。
Cisco AIOps での ServiceNow インスタンスの設定
Cisco AIOps はこの設定を使用して、ServiceNow インスタンスからインシデント、問題、または変更を取得します。Cisco AIOps で次の手順を実行して、ServiceNow インスタンスを設定します。
[Configure > Integrations] に移動します。
[Create] をクリックします。
[Name] で、統合の名前を指定します。
[Integration Type] リストから [ServiceNow] を選択します。
[Sub Integration Type] を選択します。
Incidents:ServiceNow インスタンスから Cisco Observability Platform に IT インシデントを取得します。また、Cisco Observability Platform から ServiceNow のインシデントを作成することもできます。
Problems:ServiceNow インスタンスから Cisco Observability Platform に問題を取得します。
Changes:ServiceNow インスタンスから Cisco Observability Platform に変更要求を取得します。
[Requested Parameters] を指定します。
Request Type:ServiceNow インスタンスで実行するメソッドをリストから選択します。
Raw URL:ServiceNow インスタンスの URL を指定します。
Encoding Type:エンコーディングタイプを指定します。例:UTF-8。
[Authentication] で認証タイプを選択します。
Basic:ServiceNow ユーザーアカウントのログイン情報を指定します。
Token:ServiceNow インスタンス用に生成したベアラートークンを指定します。
OAuth:ServiceNow インスタンスの OAuth の詳細を指定します。
Saml:ServiceNow インスタンスに必要な SAML の詳細を指定します。
APIkey:ServiceNow インスタンスの API キーとその値を指定します。
(オプション)カスタムヘッダーと変数を指定します(ある場合)。
(オプション)成功と失敗のステータスコードを使用して、応答処理基準を指定します。
この設定により、Cisco AIOps が ServiceNow インスタンスに接続できるようになります。
ServiceNow インスタンスでの Cisco AIOps の統合
Cisco AIOps は、ServiceNow インスタンスから更新を受信するためのエンドポイントを提供します。
https://<tenant-url>/rest/aiopsservices/webhook/api/v1/events
次のように、Cisco AIOps と統合するように ServiceNow インスタンスでこのエンドポイントを設定します。
アプリケーションレジストリの作成
アプリケーションレジストリには、ServiceNow の OAuth プロファイルが一覧表示されます。OAuth プロファイルを使用して Cisco Observability Platform に接続できます。
- ServiceNow インスタンスにログインします。
- [All > System OAuth > Application Registry] に移動します。
- [New] をクリックして OAuth プロファイルを設定します。
- Cisco Observability Platform テナントの OAuth トークンの詳細を指定します。OAuth トークンを生成するには、「サービスプリンシパルの作成」を参照してください。
- Client ID
- Client Secret
- Token URL
- Submit をクリックします。
ServiceNow はこのプロファイルを使用して、インシデント、問題、または変更に関する更新を Cisco AIOps に安全に送信します。詳細については、「Configure Application Registry on the ServiceNow instance」を参照してください。
REST メッセージの作成
- ServiceNow インスタンスにログインします。
- [All > System Web Services > REST Message] に移動します。
- [New] をクリックして、Cisco AIOps を ServiceNow インスタンスと統合します。
- 次の詳細を指定します。
- [Name]:REST メッセージを識別するわかりやすい名前。
- [Endpoint]:Cisco AIOps のテナント URL。例:
https://cisco-observe.appdynamics.com
- [Authentication]:アプリケーションレジストリで作成されたプロファイルで OAuth 2.0 認証タイプを使用します。
- Submit をクリックします。
詳細については、「Create a REST message」を参照してください。
REST エンドポイントの定義
ServiceNow のインシデント、問題、および変更の更新をプッシュするには、REST メッセージを使用して Cisco AIOps エンドポイントにアクセスする必要があります。
- ServiceNow インスタンスにログインします。
- [All > System Web Services > Outbound > REST Message] に移動します。
- Cisco AIOps 用に作成した REST メッセージを選択します。「REST メッセージの作成」を参照してください。
- [HTTP Methods] で、[New ] をクリックし、次を指定します。
- [Name]:HTTP メソッドを識別する名前。
- [HTTP Method]:リストから [POST] メソッドを選択します。
[Endpoint]:Cisco AIOps のエンドポイントパス。
https://<tenant-url>/rest/aiopsservices/webhook/api/v1/events
CODE
Save をクリックします。
詳細については、「Define a REST message HTTP method」を参照してください。
ビジネスルールの設定
インシデント、問題、変更リクエストなどのテーブルの更新をプッシュするビジネスルールを設定します。
- ServiceNow インスタンスにログインします。
- [All > System Definition > Business Rules] に移動します。
- [New] をクリックし、次を指定します。
- [Name]:ビジネスルールの名前。
- [Table]:リストから [Incident]、[Problem]、または [Change Requests] テーブルを選択できます。したがって、ビジネスルールで、選択したテーブルから更新を選択できます。
- [Active]:このオプションにより、ビジネスルールが有効化されます。
- [Advanced]:このオプションでは、スクリプトを作成できるようにフォームの高度なバージョンが提供されます。
- [When to run]:ビジネスルールを実行するタイミングを指定します。 [Insert]、[Update]、[Delete]、[Query] などのデータベースアクションを選択できます。このビジネスルールは、選択したデータベースアクションのデータのみをプッシュします。
[Advanced] で、スクリプトの REST メッセージ名とエンドポイントを指定します。
前の手順で選択したテーブルオプションのサンプルスクリプトを使用します。
(function executeRule(current, previous /*null when async*/ ) { // Create an empty object to hold the attribute-value pairs var incidentAttributes = {}; // Iterating over all fields in the current incident for (var attribute in current) { if (current.hasOwnProperty(attribute)) { // Adding each attribute and its value to the object incidentAttributes[attribute] = current[attribute].toString(); gs.info(attribute); gs.info(current[attribute]); gs.info(current[attribute].toString()); } } incidentAttributes["short_description"] = "Sent from trigger"; // Convert the object to a JSON string var jsonString = JSON.stringify(incidentAttributes); // Log the JSON string gs.info(jsonString); //var r = new sn_ws.RESTMessageV2('FSO-AIOPS-Integrations', 'eventWebhook'); //updating for alameda tenant testing var r = new sn_ws.RESTMessageV2('FSO-AIOPS-Integrations', 'eventWebhook'); r.setRequestHeader("route", "major_incident"); r.setRequestBody(jsonString); var response = r.execute(); var responseBody = response.getBody(); gs.info(responseBody); var httpStatus = response.getStatusCode(); gs.info(httpStatus); gs.info("AIOPS TEAM INCIDENT Creation -- END"); })(current, previous);
JSON(function executeRule(current, previous /*null when async*/ ) { // Create an empty object to hold the attribute-value pairs var incidentAttributes = {}; // Iterating over all fields in the current incident for (var attribute in current) { if (current.hasOwnProperty(attribute)) { // Adding each attribute and its value to the object incidentAttributes[attribute] = current[attribute].toString(); gs.info(attribute); gs.info(current[attribute]); gs.info(current[attribute].toString()); } } incidentAttributes["short_description"] = "Sent from trigger"; // Convert the object to a JSON string var jsonString = JSON.stringify(incidentAttributes); // Log the JSON string gs.info(jsonString); //var r = new sn_ws.RESTMessageV2('FSO-AIOPS-Integrations', 'eventWebhook'); //updating for alameda tenant testing var r = new sn_ws.RESTMessageV2('FSO-AIOPS-Integrations', 'eventWebhook'); r.setRequestHeader("route", "problem"); r.setRequestBody(jsonString); var response = r.execute(); var responseBody = response.getBody(); gs.info(responseBody); var httpStatus = response.getStatusCode(); gs.info(httpStatus); gs.info("AIOPS TEAM INCIDENT Creation -- END"); })(current, previous);
CODE(function executeRule(current, previous /*null when async*/ ) { // Create an empty object to hold the attribute-value pairs var incidentAttributes = {}; // Iterating over all fields in the current incident for (var attribute in current) { if (current.hasOwnProperty(attribute)) { // Adding each attribute and its value to the object incidentAttributes[attribute] = current[attribute].toString(); gs.info(attribute); gs.info(current[attribute]); gs.info(current[attribute].toString()); } } incidentAttributes["short_description"] = "Sent from trigger"; // Convert the object to a JSON string var jsonString = JSON.stringify(incidentAttributes); // Log the JSON string gs.info(jsonString); //var r = new sn_ws.RESTMessageV2('FSO-AIOPS-Integrations', 'eventWebhook'); //updating for alameda tenant testing var r = new sn_ws.RESTMessageV2('FSO-AIOPS-Integrations', 'eventWebhook'); r.setRequestHeader("route", "change"); r.setRequestBody(jsonString); var response = r.execute(); var responseBody = response.getBody(); gs.info(responseBody); var httpStatus = response.getStatusCode(); gs.info(httpStatus); gs.info("AIOPS TEAM INCIDENT Creation -- END"); })(current, previous);
CODE- [Save] をクリックします。
詳細については、「Classic Business Rules」を参照してください。
スクリプトアクションの実行
ビジネスルールに追加されたスクリプトを確認します。
- ServiceNow インスタンスにログインします。
- [Script Actions] に移動します。
- スクリプトをビジネスルールから [Run script] にコピーします。
- [Run script] をクリックします。
デバッグして、スクリプトが想定どおりに実行されるかどうかを確認します。詳細については、「Script Actions」を参照してください。
次のステップ
統合が成功すると、[Observe] ページで、インシデント、問題、および変更リクエストが [IT Service Management] の下に分離され、[IT Services] と関連付けられます。「Monitor Entities」を参照してください。
これらの資料で使用されているサードパーティの名前、ロゴ、マーク、および一般的な参照情報は、米国および/またはその他の国のそれぞれの所有者またはその関係会社の所有物です。このような参照情報の記載は、情報提供のみを目的としており、Cisco AppDynamics とサードパーティの関係を促進または示唆することを意図したものではありません。