Injecting Alerts into VMware Aria Operations
VMware Aria Operations has the ability to Alert on almost anything: metrics, properties, events, faults, and more. We can also ingest Alerts from other platforms like Microsoft SCOM, Oracle Enterprise Manager, Solarwinds NPM, and more via Management Packs. But what if we want to send Alerts from some other platform or a script, how do we get them into Aria Operations? The API! Here's how you do it.
My first thought was the Alerts endpoint.
After exploring these options, they allow the user to update Alert definitions, create them, add notes to existing Alerts, and more, but no option to generate Alerts themselves.
A teammate suggested the Events endpoint and bingo, that's it, thanks Dale! For those of you that don't know Dale Hassinger, he's a new Cloud Solution Architect on our team and we're lucky to have him. He recently presented at VMware Explore on Aria Automation, can be found on Twitter at @dalehassinger and his blog is vrcocs.info, check them out!
Let's explore the Events endpoint.
Several options, but POST /api/events is the one we want. It will allow us to inject an Event into Aria Operations, we can then create an Alert/Symptom combination against that Event.
Looking at the payload here, we need the resourceId of the object we want to create an Event against. In our case it'll be a VM, but you can generate an Event against any Aria Operations aware object. Let's go get a VM, we'll use the GET /api/resources.
Find the VM you want to attach the Event to in the Response body.
Scroll down and find the identifier for it.
Now that we have our identifier, we can use POST /api/events, in our case it'll look like this.
Execute to confirm, then go look at that VM in Aria Operations.
There it is! Now that we have an Event, one which we can control the payload on, it's easy to create an Alert/Symptom combination for it. Go to Configure - Alerts - Symptom Definitions - Message Event - ADD.
I've defined my Symptom like this.
Next define an Alert using that Symptom, go to Configure - Alerts - Alert Definitions - ADD and create your Alert. Mine looks this this.
Let's test it by injecting another Event into Aria Operations.
And there it is!
The Aria Operations API is just so powerful, make use of it! For more information on VMware Aria Operations check out our Tech Zone site!