Configuring a connection in IBM Tivoli Netcool/Impact for IBM Cloud Pak for Watson AIOps

Edit the RESTful DSA data source in IBM Tivoli Netcool/Impact for a connection to IBM Cloud Pak for Watson AIOps to finish configuring the connection and integration between IBM Tivoli Netcool/Impact and IBM Cloud Pak for Watson AIOps.

Before you begin

  1. Ensure that you have created the IBM Tivoli Netcool/Impact connection in the IBM Cloud Pak for Watson AIOps UI. The connection can be created from the Data and tool connections page in the UI. For more information, see Creating IBM Tivoli Netcool/Impact connections.

  2. Obtain the following details for your IBM Cloud Pak for Watson AIOps deployment:

    • Your IBM Cloud Pak for Watson AIOps hostname (cluster_address). For more information about obtaining this information, see Accessing your cluster by using the console.

    • Your encoded (base64 format) Platform UI API Key (ZenApiKey) for accessing IBM Cloud Pak for Watson AIOps APIs. If you do not have an existing API key and need to generate a new API key, complete the following steps:

      Accessing APIs - Get authentication by using Platform UI API Key

      You can verify that your API key works by running the following command:

      curl -kv -H "Authorization: ZenApiKey ${ZenApiKey}" -H "x-tenant-id: ${tenant_id}"  "https://${CPD_ROUTE}/aiops/api/issue-resolution/v1/alerts/"
      

      Important: If you lose your API key, repeat the preceding steps to generate a new API key. Your old API key becomes invalid, and any applications or scripts cannot authenticate to the platform until you provide your new API key. For more information, see Accessing APIs.

    • The Red Hat OpenShift Container Platform certificate for IBM Cloud Pak for Watson AIOps.

Configuring the for RESTful DSA data source

  1. Open the IBM Tivoli Netcool/Impact GUI.

  2. Click and view the Policies tab.

    If the connection in IBM Cloud Pak for Watson AIOps is successful, a RESTful DSA data source is already created. In addition, the following default policies are already created.

    • AIOPS_HandleAction - This file defines the wrapper that is used when IBM Cloud Pak for Watson AIOps invokes an action in IBM Tivoli Netcool/Impact.

    • AIOPS_Mappings - This file defines how events are sent, and mapped, to IBM Cloud Pak for Watson AIOps.

    • AIOPS_Utils - This file lists the APIs that are used for communicating with IBM Cloud Pak for Watson AIOps.

    Ensure that these policies exist before proceeding. If they are missing, re-create the connection in IBM Cloud Pak for Watson AIOps.

  3. Click the Data Model tab.

    An AIOps-<identifier> RESTful DSA data source is now listed. Click this data source to view the Restful API Data Source Editor for the data model.

  4. Go to the Source section and update the Host Name field with your IBM Cloud Pak for Watson AIOps hostname.

  5. Update the Request Header authorization setting.

    1. Go to the Request Headers section.

    2. Select the Authorization header and click Edit in the table header.

    3. Update the Header Value field to include your encoded Platform UI API Key (ZenApiKey). This value must be in the following format:

      ZenApiKey <ZenApiKey>
      

      Where <ZenApiKey> is your encoded Platform UI API Key.

    4. Click OK.

  6. Import the Red Hat OpenShift Container Platform certificate for IBM Cloud Pak for Watson AIOps.

  7. Click the Save icon to save your RESTful DSA data source configuration. Then, test your connection.

Verifying the connection

  1. Create a test event policy in IBM Tivoli Netcool/Impact to create an alert in IBM Cloud Pak for Watson AIOps.

    Your IBM Tivoli Netcool/Impact policies must be written in JavaScript to work with IBM Cloud Pak for Watson AIOps. The Impact Policy Language (IPL) is not supported through the connection.

    You can use the following example JavaScript structure to help you create your own test policy. Replace the variables <variable> with the values for your own test event and system details.

    Load('AIOPS_Utils');
    occurrenceTime = new Date();
    var myEventInstance = "<instance_name>";
    var event = {
        deduplicationKey: myEventInstance + " <event_name>",
        sender: {
          service: "<service>",
          name: "<sender_name>",
          type: "Success",
          location: "<location>",
          cluster: "\"quotes\"",
          controller: "<script>alert(\"<sender_controller>\");</script>"
        },
        resource: {
          name: myEventInstance + "<resource_name>",
          type: myEventInstance + " <type>",
          service: myEventInstance + " <service>",
          location: "<location>",
          controller: "<resource_controller>",
          interface: "<interface>",
          ipAddress: "<ip_address>",
          hostname: "<hostname>",
          cluster: "<cluster>"
        },
        type: {
          classification: myEventInstance + " <classification>",
          eventType: "<event_type>"
        },
        severity: 6,
        summary: myEventInstance + " <summary>",
        occurrenceTime: occurrenceTime.toISOString()
      };
    var res = aiopsUtils.postEventDSA( "AIOps-<UUID>" , event );
    Log("res: " + res);
    

    To obtain the UUID value to use for the aiopsUtils.postEventDSA( "AIOps-<UUID>" , event ) setting, run the following command:

    oc get connectorconfiguration -o json | jq -r '.items[] | (.metadata.name + " - " + .metadata.uid)'
    

    Note: You need jq to run this command. To install jq, see Download jq.

    Output:

    impact-netcool - 123abcd4-1ab2-1a23-1a2b-1aabbc234de5
    

    The value 123abcd4-1ab2-1a23-1a2b-1aabbc234de5 is the UUID value.

  2. Run the policy to test the connection from the IBM Tivoli Netcool/Impact UI Policies tab.

    Open the test policy that you created, and click the Run icon in the toolbar. Wait a few minutes, then proceeed to the next step.

  3. Open the IBM Cloud Pak for Watson AIOps UI and from the main navigation click Incidents and alerts. Click the Alerts tab to open the Alert Viewer.

    The alert for your test event should now display.

What to do next