We have replication between two data-centers set-up for a couple of VMs. We'd like to be able to see the
status of their replication in Nagios (maybe also stand-up alerting?), rather than having to rely on the vSphere
web client to check these manually.
I've been browsing the website & doco for the last couple of hours without much luck.
Is there an API (preferably python/perl, as we're a Linux shop) that will let me interrogate the state of
replication? Maybe an SNMP MIB? Linux command line tools I can run remotely?
Unfortunately you can't use an API as the management layer does not expose it. However you can check this post virtuallyGhetto: HBR (Host Based Replication) CLI for SRM 5 on how to query the replication engine on the source host. Keep in mind that if you use this approach there could be differences between what you can see in the VR UI and the result you will receive through that tool.
Not exactly what you are looking for, but perhaps you can use the VR events (for example RPO violated and RPO restored) posted at vCenter Server at both source site and target site and also configure alarms for them.
Thanks for the suggestion, it was very valuable for me to learn about vim-cmd usage, but not related to
my actual question (it will let me know what the CURRENT state is, but I can't find a way to extract the
time-stamp of the last successful replication (which is what we're really after).
I may start trawling the logs on the ESX servers, which will be tedious, and I'm not sure how I will
then integrate that with nagios, either, but I can do some scripting to get it sorted, I'm sure.
Please see the official documentation of vSphere API/SDK about EventHistoryCollector. This is the same functionality for all events posted in vCenter Server, not only VR ones. It is not easy, but currently VR has no public API.
An alternative approach would be to set up alarms in vCenter for the necessary VR events and execute a command to pass the data to Nagios (something similar to VMWare vCenter alarm sender - Nagios Exchange).
Hi again Martin,
I did look at the EventHistoryCollector API and put that on the back-burner for now; I'd rather try some other (simpler?)
The nagios alarm sender requires a windows piece of infrastructure which we don't have.