vRealize Operations Header

How to Add vSphere Tags to vRealize Operations Alert Emails using a Custom Payload

Wondering how to add the vSphere Tag for a virtual machine to emails sent out for alerts? I recently came across this Reddit post, so decided to try out the Custom Payload feature from vRealize (Aria) Operations and want to share the steps I took to achieve this setting.

Here‘s how to configure a Payload Template and Notification to include the vSphere Tag:

Creating the custom payload template to include the vSphere Tag

To get started, within your vRealize Operations interface (SaaS or on-premises), go to:

  • Configure > Alerts
  • Click on Payload Templates icon
  • Click Add to create a new template

vROPS - Custom Payload - Alerts - Payload Templates

  • Give your custom payload template a name,
  • a description,
  • and set which outbound method it’s tied to. For my example, it will be email.
  • Click Next

vROPS - Custom Payload - Alerts - Payload Templates - Details

Now this is where we bring in additional information to form part of our payload.

  • Select your object type, again in this example I want the vSphere tag for my virtual machines.

vROPS - Custom Payload - Alerts - Payload Templates - Object Content - Add object type - virtual machines

Once selected, you will see the dialog box update, you can add multiple objects, to make information available in your payload.

  • Click Edit on the object

vROPS - Custom Payload - Alerts - Payload Templates - Object Content - Add object type - virtual machines - Edit

  • Search and select the information you want to add
    • In this example I’m only selecting the vSphere tag, which is a property recorded against the virtual machine
  • Once finished, click the little “X” in the right-hand side, to close the editing of this object type.

vROPS - Custom Payload - Alerts - Payload Templates - Object Content - Add object type - virtual machines - Edit - Select metrics and properties

Now we can see the object type has updated to include the selected property.

  • Click Next

vROPS - Custom Payload - Alerts - Payload Templates - Object Content - Add object type - virtual machines - Tag added

The final configuration option is to create our custom Payload.

  • Add your Email Subject
  • Add your Email Body

Both options can use the parameters on the right-hand side, simply click the copy button and paste as needed.

Highlighted in Red under the parameters on the right, is the virtual machine property for vSphere Tag. Within the Body area, I’ve highlighted in red how I’ve used this.

  • Click Create

vROPS - Custom Payload - Alerts - Payload Templates - Payload Details

How to Configure a Notification with a Custom Payload Template

Now that we have our payload template, we need to create a notification or edit an existing one to use it.

  • Click on Alerts under Configure
  • Click on Notifications Icon
  • Click on Add

vROPS - Custom Payload - Alerts - Notifications

I won’t step you through each configuration tab, but it’s quite simple, the last step is where you select your payload template.

  1. Give your notification a name
  2. Define which objects and alerts this notification rule applies to
  3. Select which outbound plugin to use (in this example, email)
  4. Select which payload template to use and configure the recipients (for email notifications)

vROPS - Custom Payload - Alerts - Notifications - Select Payload Template

Example Email showing the vRealize Operations Alert with the vSphere Tag information

To finish off this blog post, here is an example output email, showing an alert cancellation notification using the custom payload template I designed, which includes the vSphere Tag for the virtual machine.

vROPS - Custom Payload - Email example

 

Regards

Dean Lewis

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.