- 08 Mar 2024
- 3 Minutes to read
- Print
- DarkLight
- PDF
Add a ServiceNow Incident Webhook to an Action Group
- Updated on 08 Mar 2024
- 3 Minutes to read
- Print
- DarkLight
- PDF
Integrating the ServiceNow alerting service into your Netreo monitoring workflow is fairly straightforward. Simply follow the steps below to create a new action group that can alert your ServiceNow account with a custom message of your choice. This action group may then be assigned to the alarm configuration of any monitoring check.
(Netreo recommends that you create a user in your ServiceNow account specifically for Netreo use.)
Procedure
First, you'll have to complete some steps in ServiceNow.
- Log into your account at the ServiceNow website.
- Make sure Incoming WebHook API Events is enabled for your account.
Once you've done that, log into your Netreo deployment as an Admin or SuperAdmin.
- Go to the main menu and select Administration > Alerts > Actions to open the Actions Administration page.
- Select Add A Group.
- In the action group configuration dialog:
- In the GROUP NAME field enter a name for this action group (for example, "ServiceNowAlert").
- No spaces are allowed in action group names.
- In the MANUAL ALERT ACCESS LEVEL field select a user access level for this group.
- This allows users with the selected access level and higher to manually run this action group from within an incident.
- Select Add Group.
- In the GROUP NAME field enter a name for this action group (for example, "ServiceNowAlert").
- In the action configuration dialog:
- In the ACTION NAME field enter a name for this action (for example, "ServiceNow Action").
- Spaces are allowed in action names.
- Select Add Action.
- In the ACTION NAME field enter a name for this action (for example, "ServiceNow Action").
- In the method configuration dialog:
- In the ACTION METHOD TYPE field select Webhook from the pull-down menu. (See Action Group for more information on webhooks.)
- In the URL field enter:
<YOUR CUSTOMER NAME>.service-now.com/api/now/table/incident
- In the PAYLOAD field enter something similar to the code in the Payload Code section further down.
- You can customize the payload to provide values for ServiceNow using any desired Netreo incident macros.
- Select Add Method.
Now select this action group in the alarm configuration of a monitoring check. When that check fails and opens an incident, ServiceNow will be alerted according to the Netreo incident state change rules.
Payload Code
- Text contained in angle brackets < > should be replaced with your appropriate values.
- For the
Authorization
value, you must provide a Base64-encoded value of the username and password for your ServiceNow account. This value can be created by entering your username and password in the formatusername:password
into https://www.base64encode.org/ (use default settings) to retrieve an encoded blob value.
- For the
- Text contained in curly braces { } represents a Netreo incident macro, and is automatically translated into readable text before the payload is sent. Replace the example macros above with the macros you wish to use. Multiple macros may be included in the same field by separating them with a blank space.
- Do not include any angle brackets < > in your payload, but do include curly braces { }.
- When constructing the output for the
description
value you may include the newline character ( \n ) to place the items that follow it on a new line. This can help make the final output much easier to read.
Payload Example
[header] { "Content-Type" : "application/json", "Authorization" : "Basic <YOUR BASE64 ENCODED SERVICENOW USERNAME:PASSWORD>" } [header] { "category" : "<YOUR CATEGORY>", "company" : "<YOUR COMPANY NAME> Netreo", "number" : "{INCIDENTID}", "priority" : "<YOUR PRIORITY>", "severity" : "<YOUR SEVERITY>", "short_description" : "{SUBJ}", "cmdb_ci" : "{HOSTNAME}", "u_alert_link" : "{INCIDENT_URL}", "description" : "{SUBJ}\n\nHost Name: {HOSTNAME}\nHost Address: {HOSTADDRESS}\nHost State: {HOSTSTATE}\nAlert: {ALERTDESC}\nThreshold Level: {THRESHOLD}\n\nIncidentID:{INCIDENTID}\nIncident State: {APPLICATIONSTATE}{SERVICESTATE}\n\n{OUTPUT}\n\nHost Note:{HOSTNOTE}\n" }
Recommended general settings are to set priority
to 3 and severity
to 2, but this will vary based on your specific response policies and implementation. If you want different alerts to go out with different priority/severity levels, you can create separate action groups to easily accomplish this.
New Incident View Field
By communicating with ServiceNow via the webhook action group above, Netreo automatically adds a new field to the info panel of the incident's Incident View page labeled "ServiceNow Ticket."
This field will contain a hyperlink directly to the ticket created in ServiceNow by the webhook, as seen in the image below. The hyperlink will be the ID of the ServiceNow ticket. Incidents not connected to a ServiceNow ticket via an action group webhook will not contain this field in their info panel.