Integrate ServiceNow with Bigeye

Integrating ServiceNow with Bigeye keeps your team in touch with the latest updates from Bigeye, keeping the systems in sync. The powerful workflow system of ServiceNow can help automate and route events received from Bigeye.

To integrate ServiceNow with Bigeye, follow these steps:

πŸ“˜

Before you begin

These integration steps were executed in a ServiceNow developer instance using the Utah release. We recommend performing the integration steps in the Studio or an application so that the changes are easily transportable to your production environment.

  1. From your ServiceNow instance, go to System Definition > Tables, or from the Studio, create a table with the following parameters:

    1. Label: Bigeye Notification
    2. Name: u_bigeye_notification
    3. Extends table: Task
    4. Create module: true
    5. New menu name: Bigeye
    6. Columns:
      1. Message (display): String (or String with Full UTF-8)
      2. Total failures: Integer
      3. Run timestamp: Date/Time
      4. Metric URL: URL
  2. Go to System Definition > Script Includes and click New.

  3. Input the following information for Script Includes:

    1. Name: BigeyeTimestamp

    2. Client callable: false

    3. Script:

      
      var BigeyeTimestamp = Class.create();
      BigeyeTimestamp.prototype = {
      	initialize: function() {
      	},
          
          convert: function(bigeyeTimestamp) {
         	 // replace T with space, truncate milliseconds
         	 var date = bigeyeTimestamp.replace(/T/, ' ').substring(0, 19);
         	 // the time is UTC, so use datetime here
         	 return new GlideDateTime(date);
          },
      
      	type: 'BigeyeTimestamp'
      };
      
  1. Click Save.
  2. Go to System Definition > Scripted REST APIs.
  3. Set the Name to Bigeye Webhook and click Submit to save the record.
  1. From the resulting record, go to the Resources tab and click New.
  1. Input the following fields for the Scripted REST Resource:

    1. Name: new

    2. HTTP method: POST

    3. Relative path: /

    4. Requires authentication: false

    5. Script:

      (function process( /*RESTAPIRequest*/ request, /*RESTAPIResponse*/ response) {
         // if there is no message, then this may not be a good request
         if (!request.body.data || !request.body.data.message) {
             response.setStatus(400);
             response.setError("Invalid Bigeye webhook message");
             return;
         }
      
      
         var totalFailures = request.body.data.totalFailures;
         var runTimestamp = request.body.data.runTimestamp;
         var metricUrl = request.body.data.metricUrl;
         var message = request.body.data.message;
      
      
         runTimestamp = new BigeyeTimestamp()
             .convert(runTimestamp);
      
      
         var gr = new GlideRecord("u_bigeye_notification");
         gr.u_total_failures = totalFailures;
         gr.u_run_timestamp = runTimestamp;
         gr.u_metric_url = metricUrl;
         gr.u_message = message;
         gr.insert();
      
      
         response.setStatus(204);
      })(request, response);
      
  1. Save the record and note the value of the Resource path field.
  2. Go to Bigeye, and navigate to a metric or collection. Edit the metric or collection and go to the Notifications tab. Enter your ServiceNow instance URL with the resource path into the Webhook field.
  1. Click Test.
  2. Check the Bigeye Notification table you created in Step 1. It must now contain a record.

Congrats, this should give you a minimally working ServiceNow webhook. There is much more you can do from here to fit your own needs:

  1. Customize the task table appearance, visible fields, and workflow.
  2. Explore additional fields sent by the webhook.
  3. Collate similar notifications into issues for the same metric.