PrintWriter out = agent.getOut();
// There are other, easier ways to do this, but I want to go through the JMX interface.
// Since this is the interface used by the agent plugin to get metric data, this prompt
// command can be used to verify the exact data the agent plugin is getting.
AgentManagement agent_mbean = agent.getAgentManagementMBean();
if (agent_mbean != null) {
try {
MBeanServer the_mbs = agent_mbean.getMBeanServer();
displayMetrics(agent_mbean.getObjectName(), out, the_mbs);
} catch (Exception e) {
out.println(MSG.getMsg(AgentI18NResourceKeys.METRICS_EXCEPTION, e));
}
} else {
out.println(MSG.getMsg(AgentI18NResourceKeys.METRICS_NO_SERVICES));