Skip to content

Instantly share code, notes, and snippets.

@kshimonoj
Last active February 26, 2019 01:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kshimonoj/2ac880bd2ea7b2831e9e52eff2b9b40f to your computer and use it in GitHub Desktop.
Save kshimonoj/2ac880bd2ea7b2831e9e52eff2b9b40f to your computer and use it in GitHub Desktop.
Aruba Central Webhook integration with Slack

Overview

Aruba Central is a cloud-based network management and monitoring solution for Aruba Instant Access Points, Switches, and SD-WAN gateways. It has lots of Alerts to notify IT managers network problems.
To receive these Alerts on Slack, you can use this Flow.

Usage

  • Setup Aruba Central Webhook to Node-RED on public server. (I used AWS)
  • Setup Slack to receive incoming Webhook.
  • Setup Node-RED Flow as a relay server.

Traffic Flow

Aruba Central --> Node-RED@AWS --> Slack incoming Webhook

How to setup Aruba Central Alerts and Webhook.

General Alert Configuration

Take a look at the Aruba's document.
You can choose Email or Webhook to send each Alert.

Webhook

  • Go to "Maintenance" > "API Gateway" > "Webhook", then create a new Webhook.
  • Put Your Node-RED URL there. (eg. http://your_server_address:1880/webhook)

How to setup Slack incoming Webhook

Take a look at the Slack's document.
You only need a Webhook URL like "https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX"

How to setup Node-RED Flow.

  • In "Set Values" function, set Slack's Webhook URL as msg.url.
  • If you need to modify messages to Slack, change "Set Messages" function.
[{"id":"45061c23.012374","type":"http in","z":"3cd249b9.0b28e6","name":"","url":"/webhook","method":"post","upload":false,"swaggerDoc":"","x":160,"y":100,"wires":[["168f5a15.982aa6"]]},{"id":"8cb4dbeb.34b038","type":"function","z":"3cd249b9.0b28e6","name":"Set Messages","func":"text1 = \"Alert Type : \" + msg.payload.alert_type + \"\\n\" \ntext2 = \"Description : \" + msg.payload.description + \"\\n\"\ntext3 = \"Severity : \" + msg.payload.severity + \"\\n\"\ntext = text1 + text2 + text3\n\nmsg.payload = {\n \"text\" : text\n}\n\nreturn msg;","outputs":1,"noerr":0,"x":520,"y":100,"wires":[["e6c9b8c0.6e1c68"]]},{"id":"168f5a15.982aa6","type":"function","z":"3cd249b9.0b28e6","name":"Set Values","func":"msg.url = \"https://hooks.slack.com/services/XXXXX\"\nmsg.headers = {\n \"Content-type\": \"application/json\"\n}\n\nreturn msg;","outputs":1,"noerr":0,"x":330,"y":100,"wires":[["8cb4dbeb.34b038"]]},{"id":"e6c9b8c0.6e1c68","type":"http request","z":"3cd249b9.0b28e6","name":"","method":"POST","ret":"txt","url":"","tls":"","x":710,"y":100,"wires":[["d08e7041.c146a"]]},{"id":"d08e7041.c146a","type":"http response","z":"3cd249b9.0b28e6","name":"","statusCode":"","headers":{},"x":850,"y":100,"wires":[]}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment