Resolve ESX Agent Issues

ESX Agent Manager can detect issues in the ESX agents that solutions deploy. Solutions can try to resolve issues when the status of an ESX agency or an ESX agent is set to red.
  • 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\AgentHandler.java
    in an editor.
You obtain the issues that affect an ESX agency or agent by using the
EventManager
to listen for issues.
A solution can try to resolve issues by calling the
EamObject.resolve(Issue[])
method on an individual ESX agent, in which case ESX Agent Manager tries to resolve the issues. The solution can also call
EamObject.resolveAll()
on an ESX agency, in which case ESX Agent Manager attempts to resolve all the issues on all the ESX agents that the ESX agency deploys.
  1. Obtain the unique identifiers of issues by calling the
    Issue.getKey()
    method.
    The EAM Sample Solution defines a method that calls the
    Issue.getKey()
    method in the
    AgentHandler.java
    class.
    public String getIssueId(Issue issue) { return Integer.toString(issue.getKey()); }
  2. Call the
    Agent.getRuntime()
    method to obtain an
    EamObjectRuntimeInfo
    object for a running ESX agent.
    The EAM Sample Solution implements
    Agency.getRuntime()
    in a method that checks for a running ESX agency and obtains the runtime information for that ESX agency.
    public Issue getIssue(String issueId) throws RuntimeFaultFaultMsg { waitForSetup(); EamObjectRuntimeInfo runtime = getRuntime(); assert runtime != null; [...] }
  3. Call the
    EamObject.queryIssue()
    method to obtain the list of issues affecting an ESX agency from the runtime of that ESX agency.
    The EAM Sample Solution adds any issues that it discovers for the ESX agency to a
    List
    object, and returns the issues with their issue identifiers.
    public Issue getIssue(String issueId) throws RuntimeFaultFaultMsg { waitForSetup(); EamObjectRuntimeInfo runtime = getRuntime(); assert runtime != null; List<Issue> issues = _eamConnection.getStub().queryIssue(_agency, null); if (issues == null) { return null; } for (Issue issue : issues) { if (getIssueId(issue).equals(issueId)) { return issue; } } return null; }
  4. Call the
    EamObject.resolveAll()
    method to resolve all issues with ESX agents running in an ESX agency.
    The EAM Sample Solution calls the
    resolveAll()
    method on the
    Agency
    object that the
    AgentHandler.java
    class creates.
    public void resolveAll() throws RuntimeFaultFaultMsg { waitForSetup(); _eamConnection.getStub().resolveAll(_agency); }
  5. Call the
    EamObject.resolve()
    method to resolve a specific issue with an ESX agent.
    The EAM Sample Solution calls the
    resolve()
    method on the issue identifier that the
    getIssue()
    method returns, and generates a list of unknown issues that the solution cannot resolve.
    public void resolve(String issueId) throws NumberFormatException, RuntimeFaultFaultMsg { waitForSetup(); List<Integer> unknownIssueIds = _eamConnection.getStub() .resolve(_agency, Collections.singletonList(Integer.parseInt(issueId))); if (unknownIssueIds != null) { _log.error("Failed to resolve issue:" + issueId); } }
You called the methods from the ESX Agent Manager API to obtain issues and attempt to resolve them.