This section provides a short introduction to the HA Application Monitoring SDK. You need information in vSphere HA Application Monitoring to proceed further.SDK function definitions and simple documentation are in the vmGuestAppMonitorLib.h include file.You can enable heartbeats with the compiled 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 stops listening to heartbeats from this guest.
■ markActive – This starts sending the actual heartbeat every 30 seconds or less.
■ isEnabled – Indicates whether the heartbeat monitoring was enabled.
■ getAppStatus – Gets the status of the application, either Green, Red, or Gray.
■ postAppState – Posts the state of the application. Arguments can be:
■ appStateOk – Sends an “Application State is OK” signal to the HA agent running on the host.
■ appStateNeedReset – Sends an “Immediate Reset” signal to the HA agent running on the host.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
■ d – disable application monitoring and exit the program. This does not cause a reset.
■ c – continue sending heartbeats.