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
- 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
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.
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
- 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.
Now we can see the object type has updated to include the selected property.
- Click Next
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
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
I won’t step you through each configuration tab, but it’s quite simple, the last step is where you select your payload template.
- Give your notification a name
- Define which objects and alerts this notification rule applies to
- Select which outbound plugin to use (in this example, email)
- Select which payload template to use and configure the recipients (for email notifications)
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.