Using the HA Application Monitoring APIs

You can use the HA Application Monitoring SDK to create a stand-alone application monitoring program, or to enhance an existing application or script. The purpose of your application monitoring program determines the API call sequence and the application behavior that you write to handle the response data.
For example, if your application monitoring program is tracking critical applications that are running in a guest OS, your application can intentionally stop sending heartbeat signals if any application-related process fails. The HA monitoring agent interprets the absence of heartbeats as a failure, and resets the virtual machine.
Alternatively, instead of not sending heartbeat signals, your application monitoring program can set the
needReset
flag using the
VMGuestAppMonitor_PostAppState
call. When the HA monitoring agent notices this flag, it will reset the virtual machine.
Most of the calls you make using the HA Application Monitoring APIs send information to the virtual infrastructure of the ESXi host, and the host relays the information to the HA monitoring agent. However, the
VMGuestAppMonitor_GetAppStatus
call is a two-way transaction that lets you request the virtual machine status from the HA monitoring agent.
Most HA Application Monitoring functions lack input parameters, because the calls are local. The vSphere infrastructure passes the heartbeat and status data to and from other levels of the cluster.
Call each function from your application monitoring program. The vSphere infrastructure (in the virtual machine where the application monitoring program is running) passes the function data up to the ESXi host. The local virtual machine sends all status responses to your application monitoring program, even though they are passed down from the HA monitoring agent.