vCenter Server 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.
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 vCenter Server 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 vCenter Server. Solutions can provide the following statuses to vCenter Server:
- 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.java defines the health statuses for the EAM Sample Solution.
- HealthStatusServlet.java dynamically creates the XML file in which the solution exposes health status data. For an example of the XML file that HealthStatusServlet.java creates, 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.
Prerequisites
-
Verify that you have set up and started the EAM Sample Solution in an application server.
-
Verify that you have opened eam_work_folder\src\com\vmware\eam\sample\solution\Manager.java in an editor.
- Examine the code of the VimHealthProvider.java and HealthStatusServlet.java classes to see how they extract health data from the EAM Sample Solution and publish it in an XML file.
Procedure
Example: Contents of the EAM Sample Solution Health XML File
The EAM Sample Solution publishes health data at http://<solution_ip_address>:<solution_port>/eam-sample/health/health.xml. The HealthStatusServlet.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.
<vimhealth schemaVersion="1.0"> <health id="com.vmware.eam.sample.solution"> <name>EAM Sample Solution</name> <status>green</status> <message id="com.vmware.eam.sample.solution" level="info" time="current date and time">Running</message> </health> </vimhealth>