This section provides a short introduction to the HA Application Monitoring SDK. You need the information in vSphere HA Application Monitoring to proceed further.SDK function definitions and simple documentation are in the vmGuestAppMonitorLib.h include file.To run HA application monitoring programs, the virtual machine’s host must be running ESX/ESXi 4.1 or later, and application monitoring must have been enabled when configuring HA.You can enable heartbeats with the precompiled vmware-appmonitor program. Usage is as follows:
■ enable – Enable application heartbeat so vSphere HA starts listening and monitoring the heartbeat count from this guest virtual machine. The heartbeats should be sent at least once every 30 seconds.
■ disable – Disable the application heartbeat so vSphere HA stos listening to heartbeats from this guest.
■ markActive – This starts senting the actual heartbeat every 30 seconds or less.
■ isEnabled – Indicates whether the heartbeating was enabled.
■ getAppStatus – Gets the status of the application, either Green, Red, or Gray.On Linux, set your LD_LIBRARY_PATH environment to the install location of GuestSDK/lib/lib32 or lib64. On Windows, you can set your PATH environment, but it is probably easier to copy vmware-appmonitor to the same folder as the DLL files.You need a C compiler and the make program.
1 Go to the docs/VMGuestAppMonitor/samples/C directory.
2 Run the make command.
3 Set LD_LIBRARY_PATH as described above.
1 Go to the docs/VMGuestAppMonitor/samples/visualstudio folder.
2 Open the appmon.vcproj file and build the solution.
3 The sample program enables HA application monitoring and sends a heartbeat every 15 seconds. Once the program is running, typing Ctrl+C displays three choices:
■ s – stop sending heartbeats and exit the program. This should cause a reset of the virtual machine.
■ d – disable application monitoring and exit the program. This does not cause a reset.
■ c – continue sending heartbeats.