This repository contains a script that you can use in EnterpriseAlert to easily send alert notifications to SIGNL4 teams. This can be very helpful as it allows to utilize your secure and well managed EnterpriseAlert system as an on-premises proxy to the cloud.
The workflow consists of a REST source in EA and an alert policy. For each team in SIGNL4, you need one REST source and one alert policy. When one of your teams send data to its EnterpriseAlert REST source, this event triggers the policy of that team. The alert policy addresses the script in this repro which sends the event to the webhook of that team in SIGNL4.
Follow the steps below to prepare your EnterpriseAlert system.
- Open the Scripting Host in EA under System -> ScriptingHost
- Click Create New to add a new script
- Select a name for the new script and ensure to have the same settings as in the below screenshot
- Click Save
- Select JavaScript for the Scripting language dropdown
- Open the file WebhookGateway.js from this repo in your favorite text editor, copy all its contents and paste them into the script text area of thew script you are about to create
- Click Save to save the new script in EnterpriseAlert
Each time you wish to povision the notification workflow to a new SIGNL4 team, follow these steps:
- Open the event sources in EA under System -> Event Sources
- Click 'Create New' and select REST Client
- Identify the team secret from the SIGNL4 team you wish to include. Details where to find it can be found here.
- For security reasons, convert the team secret to Base64, e.g. here
- The name of the REST API source for your SIGNL4 team must be in this format: SIGNL4_[anyname]_[Base64teamsecret]
- [anyname] can be any name that helps you to identify this team, e.g. Support
- [Base64teamsecret] is the team secret in Base64 format you created earlier
- Once your source looks similar as in the example below, click Save
- Next, create an Alert Policy for this team under Alerts -> Alert Policies -> Create New
- Enter a name for the new policy, e.g. 'SIGNL4 Support Team Alerts'
- Select the previously created event source as source for this policy and click Next
- Leave the conditions as they are and proceed
- Under Alerting select Custom (Script) as workflow type and choose the script you have deployed above as target.
- Once your policy looks similar as in the screenshot below, click Save
You can now hand out the API key from the REST source to the people in your organization that want to send alert notifications to their team in SIGNL4 via your EnterpriseAlert system. Any data they POST to their event source triggers their policy which forwards it to their SIGNL4 webhook via the script. As the EnterpriseAlert REST API and the SIGNL4 webhook are highly flexible and do not require any specific schema, they can send what they want.