Learn all about vROps REST notifications and REST API’s in 60 minutes
Purpose:
vRealize Operations Manager (vROps) is an absolutely amazing and must have tool for any virtualised datacenter. Out of the box (OOTB), it provides a lot of functionalities. Unlike custom dashboards and super metrics, REST API's are less explored areas of vROps. For notifications, we typically use "Send an Email" as a notification option. The less explored options are SNMP notifications and REST notifications plugins. So we should use REST notifications plugin over others and how can we do it? How can we utilize the REST API's to do something programmatically or say simply collect information from vROps? This post answers and explores those options. If you have vROps in your environment and want to explore these areas, then this video is for you.
Introduction:
Notification is an important and integral part of any monitoring and analytical tool. A tool may be very good but if it cannot send me a notification, then it is of not much use to me. For example, consider my datacenter has serious issues, few servers went down at 2 a.m. in the morning. I get an alert in the tool console but do not get a notification about it. So I cannot do much about it. So the tool fails the purpose.
The second point, out of the box vROps provides a lot of information. It collects, processes and shows the information in UI console and Dashboards. What if I want to collect some information from vROps and process it as per my requirement? How can I get that RAW information that vROps collects? We can do that easily by using REST API's. Using REST API's we can not only collect information but do many tasks programmatically. So to automate REST API's is very useful. So it is essential to know how to interact and utilise those API's.
This blog post covers both the areas.
Why use REST notifications Plugin?
For notifications, we can use Email plugin, SNMP plugin or REST based notification plugin. So why should we use REST notification?
While SNMP notification configuration is easier, handling it is more complex and inefficient. For this example, we will consider vRO server as trap destination. In SNMP, vROps server works as a source and vRO server (or any SNMP traps receiver) as sink. So for any defined alert and notification, we get SNMP traps to vRO. So in vRO, we need to continuously monitor for any incoming traps and then parse each of them to identify whether it satisfies our criteria to run a workflow. In comparison, for REST notifications, we configure an outbound instance for a single workflow only. So if the alerting criteria is met, then the outbound notification is fired and corresponding workflow is run in vRO. There is no need for constant monitoring of the traps.
So REST notifications is much more precise and efficient.
What is covered?
When we talk about information in terms of vROps. There are two aspects.
- Information Sharing
- Information Gathering
In the first part, I will cover about "Information Sharing". Since vROps already provides so much information so we can focus on Information Sharing first. In the second part, I will cover "Information Gathering" using REST API's.
Specifically, the following topics are covered in this post:
- How to create Outbound Instance using REST Notification Plugin
- What is Webhook-Shims and why you need one
- Configuring custom "Symptom Definition"
- How to configure custom "Alert Definition"
- Tying everything together and configure notifications using all the above
- How to explore and know details about vROps REST API's
So if you are looking for these information, please run and watch the video.
Conclusion:
vROps is a very powerful tool for monitoring and analysing a virtualised datacenter. With proper alerting and notifications we can avoid many operational disruptions. Also at the same time automating tasks with vROps we can make our datacenter more efficient.
I hope this post makes these areas clear to you. For more details please check vROps documentation. Also check the following blogs for more information on this.
- More on Webhooks
- Amazing blog series by John Dias on Webhook Shims configuration
- VMware github page on Webhook-Shims
As always do provide me feedbacks so that I can make more meaningful and useful blog posts for you.
Related post:
I have written a small python script which gets the raw metrics from vROps for you. You need to provide inputs like how many metrics and which metrics you want to gather information for, how many samples you want to collect, etc. Once you provide the required inputs, the script will fetch and store the information in JSON format. You can further use the information as per your requirement. You can check it here.