Integrate Appneta Monitoring Data with ServiceNOW
search cancel

Integrate Appneta Monitoring Data with ServiceNOW

book

Article ID: 258035

calendar_today

Updated On:

Products

AppNeta DX NetOps

Issue/Introduction

ServiceNow has taken the lead in the help desk software market, offering its many customers a way to streamline their service tickets and make IT support teams more efficient. We hear often from our customers that ServiceNow has become a go-to, mission-critical application for them. Part of our continuing work and development is around tight integration of AppNeta data with the many other tools that customers are using, especially as they move more workloads to a SaaS and cloud model.

The AppNeta REST API allows for all kinds of interesting dashboards and data-sharing arrangements. In this API economy, software tools become ever more valuable as they’re connected to other apps and integrated tightly with APIs. We’ve heard what our customers need, and created this simple process so you can pull AppNeta alerts right into ServiceNow. We'll walk you through the process of setting up real-time alerts from AppNeta to a ServiceNow scripted web service.

Resolution

How to Set Up Real-Time AppNeta Alerts in ServiceNow

  1. The first step is to log in to ServiceNow
  2. Navigate to System Web Services -> Scripted Web Service -> Scripted REST APIs

3. At the top of the page click New

4. Give your new web service a name and ID and click submit

5. Once the page refreshes, you will need to create a new resource for your web service. Click on NEW at the bottom of the page.

6. Give your resource a name and change the HTTP method to POST

7. The last step on this page is to add our code to the script box. Below is a sample you can copy and paste. The only changes necessary are to update the line that says var apmServer = “demo”; You should change “demo” to match your apm server (e.g. app-02, app-03, etc....) and update the user account to match a valid ServiceNow account var callerId = 'AppNeta Alert';

(function process( /*RESTAPIRequest*/ request, /*RESTAPIResponse*/ response) {
 var dataString = request.body.dataString;
 var parser = new JSONParser();
 var parsedResponse = parser.parse(dataString);

//Change to match your APM server
 var apmServer = "demo";
 //Change this to a valid ServiceNow user account. This will display as the user who opened the ticket
 var callerId = 'AppNeta Alert';


 //Setup variables to represent the data contained within the request body
 var description = parsedResponse.description;
 var pathname = parsedResponse.pathName;
 var eventTime = parsedResponse.eventTime;

//Create a new reference to the incident table
 var rec = new GlideRecord('incident');

//Create a deep link to include in our incident that shows the last 20 mins of data for our problem path
 var deepLink = "https://" + apmServer + ".pm.appneta.com/pvc/pathdetail.html?st=3&pathid=" + parsedResponse.pathId + "&timeStamp=" + (eventTime + 1) * 1000;

rec.initialize();
 //Set the fields of our new incident
 rec.short_description = pathname + ": " + description;
 //Set the ticket opener
 rec.caller_id.setDisplayValue(callerId);
 //Set the ticket urgency to a Medium
 rec.urgency = 2;
 //Add a comment with the alert contents and link to the problem path
 rec.comments = dataString + "\n" + "[code]<a href=\"" + deepLink + "\">" + deepLink + "</a>[/code]";

 //Insert the record into the incident table
 rec.insert();

})(request, response);

8. Click Update to save your new web resource.

At this point, our web service is now ready to handle any incoming requests and create a new incident.

Sending Alerts Via REST

Now, here’s how you set up appliances to send the alerts via REST.

  1. Log in to the AppNeta portal
  2. Hover over the gear icon and click the API link under the General section near the bottom of the menu

 

3. Expand the observer section and click on POST /v3/observer

4. Copy and paste the following JSON into the body section under Parameters. Make sure to update the URL section to match the URL you created in ServiceNow.

[{"url": "https://[YOUR SERVER].service-now.com/api/168000/incident_creation", "testEvents": false, "seqEvents": false, "sqaEvents": true }]

5. Click the Try it out! Link. If everything worked, you should see a 200 response code letting you know it was successful.

At this point everything is set up to create a new incident on alert.