0
我是一個有Hyperic的新手,但我很高興發現這個工具它非常強大,我認爲它可以完全適應我的需要。我在使用API時遇到問題。我試圖通過Java直接使用它,我試圖讓我的代理,因爲我需要它在進一步的操作。Hyperic HQ Api獲得代理
如果我直接使用命令行,它可以很好地工作。
./hqapi.sh agent list --host localhost --port 7080 --user hqadmin --password hqadmin --secure false
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<AgentsResponse>
<Status>Success</Status>
<Agent id="10001" address="127.0.1.1" port="2144" version="4.4.0" unidirectional="false"/>
</AgentsResponse>
但是,當我嘗試在Java中獲得此代理時,出現一個我不知道如何解決的錯誤。
AgentsResponse agentsResponse = agentApi.getAgents();
if(agentsResponse.getStatus() != ResponseStatus.SUCCESS){
log.info("Fail retrieving agent " + agentsResponse.getError().getReasonText());
log.info("More info " + agentsResponse.getError().getErrorCode());
失敗檢索代理無法反序列化結果 更多信息UnexpectedError
我使用的Hyperic 4.4.0所以我用HQAPI V3.2。我的java類在Apache ServiceMix 4.5.3中運行,我使用提供的.jar將這個庫添加到我的Maven倉庫中。
任何幫助將如此讚賞。
非常感謝大家。