Scenario: I have two webhook URLs:
I need to send different alarms to different webhooks. (For example - all CPU-related alarms to the first one and all memory-related alarms to the second one (from the CDM probe)). How can I accomplish this?
Release : 20.3
Component : UIM - MESSAGEGTW
First we need to set up an attach queue for each webhook. The way this works is like this:
You set up a NAS AO Profile for each webhook which determines which alarms go to that webhook
The NAS probe puts a message into the ATTACH queue we create
The messagegtw probe reads this queue and pulls out the messages
The messagegtw probe sends the messages as configured to the webhook URL(s)
Since I have two webhook URLs I will need two queues.
In IM, open hub GUI and go to Queues Tab.
Create a new “attach” queue, subject: probe_messagegtw and give it a name that identifies it as belonging to a specific URL. The exact queue name doesn’t strictly matter other than you will need to be able to identify it later.
Do this again for each URL you have.
After these are created, restart the hub/robot.
Now deploy the messagegtw probe - this goes on the primary hub so that it can read the queues we created.
You have to use Admin Console to configure this probe, so we go to Admin Console and open the GUI.
Create a new profile-
In the profile you will need to specify a unique name. For queue name, put the name of the queue created in the previous steps.
Check “attach queue” which tells the probe to look in this queue for messages.
“Send Exclusive” means that if you define more than one URL, only send to the first one (the others are fallbacks). If you uncheck this it will send to all configured URLs. I checked the box here because I’m going to configure only one URL.
“Alert on label” should say “Alert on failure” - it is mislabeled - check this if you want an alarm if the webhook cannot be reached.
Note - by default, bulk size is empty - don’t leave it empty but set it to 10. If left blank the probe may fail to properly restart.
Now reload/refresh the probe and you will see where you can configure an Endpoint. Click New and enter the info:
You will have to also configure the payload mapping/headers/etc as appropriate for whatever you are sending to.
Now repeat this for another profile. Click the dots, click New Profile, and point this one to the other attach queue you created.
Configure the 2nd profile with your other URL:
Now, as mentioned our "example" goal here is to send “CPU” alarms to webhookA and “Memory” alarms to webhookB.
To do this we need to set up NAS Auto Operator profiles for each type of alarm.
NAS probe GUI->Auto Operators->New
Action type: webhook
In the “Webook Name” field is a dropdown you can choose “Webhook URL A” or “Webhook URL B” here.
Then for example, create a second profile to match on memory instead of CPU and choose "Webhook URL B"
Result: alarms with “cpu” in message string get posted to the URL A, alarms with “memory” in the message string to go URL B.