Automating Virtual Replication vCenter Alarms | Zerto

Automating Zerto’s Virtual Replication vCenter Alarms

March 15, 2018
Est. Reading Time: 6 minutes

You’ve installed Zerto’s Virtual Replication and you can finally relax. The installation went seamlessly and all that remains is to check in with your environment to ensure everything is running as expected. There’s just one problem – you see an error message. It can be a bit of a challenge at times to understand exactly what is going on and where to look for the cause.

One of the first questions I get from users after they have installed Zerto in their VMware environment is how can they receive notifications from ZVR. One option is to enable SMTP notifications from within the Site Settings tab of the ZVM UI:

For some users this works and they are easily able to configure SMTP. However, some environments may have centralized monitoring & notifications and users would like to receive these out of vCenter. Fortunately, we have a solution! Within VMware environments with Zerto there are pre-configured alarms in vCenter as part of the ZVR install process. These alarms all have the prefix of “com.zerto.event” and be found in the Alarms section of vCenter under Definitions:

There are a few options for notifications of these alarms, two of them being ‘Send a notification email’ and ‘Send a notification trap’ (SNMP):

Today we’re going to discuss using a PowerCLI example to automate the configuration of these alarms. Before getting started, make sure your vCenter environment has SMTP notifications enabled, as this is required. Refer to the appropriate VMware documentation on how to configure vCenter SMTP settings for your version of vSphere.

The example provided today requires the user to fill out a CSV file that is referred to as the “Alert Profile”. A few prepopulated template profiles have been provided for users as examples. A user can choose whichever alerts they would like to place in the Alert Profile based on the environment and the information a user is looking to capture. These alerts generate emails via vCenter.

Here is an example of an Alert Profile:

The important fields to complete are the EmailTo and EmailCC fields as these are necessary for vCenter to know who the email recipients will be. You can also edit the EmailDescription column if you’d like, but all of the other columns are recommended to leave as is.

Once you have the Alert Profile configured the way you would like it, you’ll need to configure the variables at the top of the example script:

Run the script once these variables are complete and you are ready.  At the end of the script a CSV will be exported which will have the details on what alarms you have configured. This report can be used in combination with the removal script we’ve provided if you decide you’d like to remove the alert notifications you’ve configured.

Once the script is complete you can log into vSphere and review the alert to see that ‘Send a notification email’ has been configured as expected. After the script has completed and a notification is triggered, the individuals in the Alerting Profile will receive an email like the example below:

Something I’d like to highlight for you in the email is the ‘Severity’ of the notification. This helps you to know whether Zerto classifies this as an ‘Error’, and as such should be investigated as quickly as possible, or as a Warning’.

The hyperlinks in the ‘Additional details’ section are also important to note. These link directly to the local ZVM’s online help documentation and provide further information on the specific alert, including potential causes and steps to resolution. These links do not require a ZVM login to be able to view the help documentation. An example of the documentation is displayed below:

The corresponding ZVM Alert ID’s are also noted at the bottom of the email along with a direct link to the alerting tab of the ZVM user interface. Selecting this hyperlink will require a Zerto user account to log into the ZVM interface.

Once the user is successfully authenticated they will be navigated directly to the Alerts section of the monitoring tab where they can review the alert, or search by the specific ID provided in the email:

Lastly, as long as the event or issue triggering these alerts is still occurring an email notification will be sent from vCenter to the recipients at an interval of every 5 minutes. This can be adjusted or removed from within the script if needed. If for any reason a user decides that they’d like to remove the alerting configuration that was configured, as noted previously there is a separate script to remove the notifications for the com.zerto.event alerts.

If you would like the script, comment on the myZerto forum post here and we will send you the zip file which contains the alert configuration script, alert profiles, and the removal script.

As always please feel free to provide us feedback on how this worked for you, we’ve opened this post in our myZerto forum where you can provide feedback. We hope that as you operationalize Zerto in your VMware environment this example helps.

 

About the Author (Shaun Finn):

Shaun Finn is part of the Product Management team at Zerto. He’s been in the IT industry for over 10 years, and with Zerto for almost 4 years. Shaun started in the Professional Services department at Zerto architecting and implementing solutions for customers.