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 openedin an editor.eam_work_folder\src\com\vmware\eam\sample\solution\AgentHandler.java
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.- Obtain the unique identifiers of issues by calling theIssue.getKey()method.The EAM Sample Solution defines a method that calls theIssue.getKey()method in theAgentHandler.javaclass.public String getIssueId(Issue issue) { return Integer.toString(issue.getKey()); }
- Call theAgent.getRuntime()method to obtain anEamObjectRuntimeInfoobject for a running ESX agent.The EAM Sample Solution implementsAgency.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; [...] }
- Call theEamObject.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 aListobject, 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; }
- Call theEamObject.resolveAll()method to resolve all issues with ESX agents running in an ESX agency.The EAM Sample Solution calls theresolveAll()method on theAgencyobject that theAgentHandler.javaclass creates.public void resolveAll() throws RuntimeFaultFaultMsg { waitForSetup(); _eamConnection.getStub().resolveAll(_agency); }
- Call theEamObject.resolve()method to resolve a specific issue with an ESX agent.The EAM Sample Solution calls theresolve()method on the issue identifier that thegetIssue()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.