This blog post explains in detail an example I worked out for the vRealize Orchestrator mini-workshop I have been teaching in the Benelux Summer School. If you did not attend and need an introduction to Orchestrator, have a look at my Orchestrator resources mindmap. I especially recommend the free video course to get you started ! If you do not immediately have an environment to try this out, I recommend you use the Hands-on Labs. HOL-SDC-1421, for example, has a complete Orchestrator environment. Click the Start menu, VMware to find the Orchestrator client.
IFTTT (“If-This-Then-That”) is a simple but very effective programming system for everyone on the web. For free ! You get “channels” to interact with a service, like Instagram or Philips Hue lights, there are tons of possible channels. With a “Do recipe” you can quickly create your own interaction. An “If recipe” runs in the background and automates stuff for you. I have for example a recipe I use all the time: when I see an interesting tweet I want to save (I use Evernote religously) I just favorite it. An If recipe then automatically stores it in Evernote. With content sorted in certain fields.
Admins are always looking to have easy alerting in case of problems on smart phones, pagers,… How cool would it be to interface anything that lives in vRealize Orchestrator (vRO) with IFTTT ? You can send alerts to Android or iOS native notifications, or change your Hue lights to red if you have a performance problem, or… whatever you can come up with.
IFTTT now comes with a channel to basically interface anything that has a REST API interface: Maker channel. It can receive messages on a trigger or send web requests. And did I mention all of this is free ?
So I thought it would be cool for the workshop to build a workflow that sends notifications to my iPhone from vRO. You can enhance this to send any notification, like SNMP alerts using the SNMP module. What we need to do is:
- Build an IF recipe in IFTTT that always listens to vRO sending a POST request to the Maker channel API interface.
- Register IFTTT as a RESTHost in our Orchestrator inventory.
- Register the POST action in Orchestrator as a RESTOperation.
- Use the “Invoke REST operation” workflow in your own workflow.
You need to activate the Maker channel in IFTTT to get a personal key and do REST calls.
I am sending events called “vCO” to recognize things coming from vCO, so you need to create a recipe that triggers on those messages and passes them along. I send them to iOS notifications.
Register IFTTT as RESTHost.
As said I registered the Maker channel IFTTT host in Orchestrator as a REST host. There is a workflow to do this called “Add a REST host” in Library/HTTP-REST/configuration. The REST library is installed by default in vRealize Orchestrator, so you just provide the right parameters. In my case I need a proxy to get out on the internet.
Register POST action.
In the same way we added a REST host to vCO, we add a REST operation to that host with the name VCOevent, using the workflow “Add a REST operation”. You recognize the URL template as the url string I have to send to IFTTT with my personal key, “vCO” trigger and one parameter. You can of course use other events and more parameters and change the text.
vCO Workflow for IFTTT.
My worflow now consists of one embedded workflow “Invoke REST operation”. You can download it here, import it in your Orchestrator and adapt it for your own use. The REST operation/host has a default value in attributes as defined previously. I only have to pass a parameter. In Orchestrator an extremely handy tool is visual binding, which helps you see how parameters link from one module to the next.
Now if you run the workflow a message will magically appear on my iPhone ! Note that the Orchestrator client is great for debugging: each time you run a workflow a token is created with logs. You can check that the workflow ran and that the status code for the REST operation is 200 if successful.
And of course on your iphone you get a notification:
Cool hum ? Can you imagine some useful interactions ? Sending vRealize Operations smart alerts to your iPhone ? vCenter errors ? Let me know in the comments if you adapted this for your use. Enjoy !