Set Up Health
Monitoring for a SolutionLast Updated December 19, 2024
pulls data from solutions about their health status.
Solutions expose health data by providing a URL to an XML file that defines the
health model of the solution.
- Verify that you have set up and started the EAM Sample Solution in an application server.
- Verify that you have openedin an editor.eam_work_folder\src\com\vmware\eam\sample\solution\Manager.java
- Examine the code of theVimHealthProvider.javaandHealthStatusServlet.javaclasses to see how they extract health data from the EAM Sample Solution and publish it in an XML file.
All solutions must provide an
XML file that specifies their health model. The health specification XML file
for your solution must conform to the VMware Health Service extensible schema
definition (XSD). See
Solution Health XML Schema
for the complete VMware solution health schema.
Solutions expose health data
about themselves to
by publishing XML documents that declare different health statuses, depending
on the events that occur in the solution. You provide messages to accompany
each health status in the XML document that the solution exposes to
.
Solutions can provide the following statuses to
:
- alert
- warning
- info
When you develop a solution,
you must include a program or function that generates the health status XML
file for the solution. The health status of a solution can be red, yellow, or
green.
You must pass a URL to the XML
file that defines the health model for a solution to the
ExtensionHealthInfo
object in the program that manages the solution.
The EAM Sample Solution
provides two classes that provide health data about the solution. You find
these classes in
.
eam_work_folder
\src\com\vmware\eam\sample\solution\health- VimHealthProvider.javadefines the health statuses for the EAM Sample Solution.
- HealthStatusServlet.javadynamically creates the XML file in which the solution exposes health status data. For an example of the XML file thatHealthStatusServlet.javacreates, see Contents of the EAM Sample Solution Health XML File .
In the EAM Sample Solution,
the
Manager.java
class
implements
ExtensionHealthInfo
.
The
Manager.java
class
sets a URL to a health definition XML file in the
ExtensionHealthInfo
url
property. The URL that
Manager.java
provides
is the path to the
health.xml
file that
HealthStatusServlet.java
creates.
- Create a program that defines the health statuses of the solution.The EAM Sample Solution defines the health statuses in theVimHealthProvider.javaclass.
- Create a program that creates an XML file that exposes the health status data, conforming to the VMware health service XSD.The EAM Sample Solution creates the health data XML file in theHealthStatusServlet.javaclass.HealthStatusServlet.javaimplementsVimHealthProviderto extract the health status from the solution. The class creates an XML file,health.xml, that exposes the health data about the solution according to the health status thatVimHealthProviderprovides.
- Create an instance ofExtensionHealthInfoin the program that manages the solution.The EAM Sample Solution implementsExtensionHealthInfoinManager.java.
- Call theExtensionHealthInfo.setUrl()method to set the URL at which the solution publishes its health data XML file.The EAM Sample Solution publishes an XML file,health.xml, that theHealthStatusServlet.javaclass generates.
- Call theExtension.setHealthInfo()method to add theExtensionHealthInfoobject to the solutionManager.javaprovides a link to thehealth.xmlXML file that theHealthStatusServlet.javaclass generates.
Contents of the EAM
Sample Solution Health XML File
The EAM Sample Solution
publishes health data at
http://
.
The
<solution_ip_address>
:<solution_port>
/eam-sample/health/health.xmlHealthStatusServlet.java
class in the EAM Sample Solution generates this file when the solution starts.
This example shows the XML file that
HealthStatusServlet.java
generates when the EAM Sample Solution is running correctly.