A raised alert typically indicates a network, application, or performance problem that requires issuing an incident ticket into the tracking system or adding an entry to a system log. To automate this process, the report server can run a custom script when an alert is triggered.
The following examples present Microsoft PowerShell v.4 scripts to deliver the notification:
using SOAP to report it in ServiceNow as an incident. For more information, see Creating ServiceNow incident using PowerShell script and SOAP.
using REST to report it in ServiceNow as an event. For more information, see Creating ServiceNow event using PowerShell script and REST.
reporting it in Microsoft Windows Event Log as an event. For more information, see Creating Windows Event Log event using Windows command.
Before you start
Which scripting languages can I use?
You can use any scripting language as long as its interpreter is installed on the report server. Our examples all use the Windows PowerShell scripting included in standard Windows Server deployments.
Windows user rights
Make sure that the user running the CAS service has sufficient permissions to execute your scripts.
Delivering alert notification as ServiceNow incident
In this example, we create a PowerShell script which, when it is triggered, generates a message that automatically creates an incident item in the ServiceNow system.
Using the available parameters, we modify the alert notification to automatically generate a URL pointing to the CAS report containing detailed information about the reported problem. Though this URL will be passed to the ServiceNow in the script as part of the notification message, we also pass this URL as a separate script parameter which is inserted in the custom clickable form field in the ServiceNow Incident form.
You can use the REST API or SOAP API to pass the message to the ServiceNow system. Both methods require preparation of the ServiceNow system. For more information, see Configuring ServiceNow Web Services Security Profile and Configuring ServiceNow User and assigning roles.
Before configuring the script recipient, make sure you have the following information:
ServiceNow username and password.
If you plan to deliver the notification using SOAP and report it in ServiceNow as an incident.
If you plan to deliver the notification using REST and report it in ServiceNow as an event.
If you plan to deliver the notification using REST and report it in ServiceNow as an incident.