mirror of https://github.com/apache/cloudstack.git
agent: don't investigate if host is null, send alert instead
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
parent
419508b016
commit
fb1069ace9
|
|
@ -438,20 +438,22 @@ public class AgentManagerImpl extends ManagerBase implements AgentManager, Handl
|
|||
|
||||
protected Status investigate(AgentAttache agent) {
|
||||
Long hostId = agent.getId();
|
||||
if (s_logger.isDebugEnabled()) {
|
||||
s_logger.debug("checking if agent (" + hostId + ") is alive");
|
||||
}
|
||||
|
||||
Answer answer = easySend(hostId, new CheckHealthCommand());
|
||||
if (answer != null && answer.getResult()) {
|
||||
Status status = Status.Up;
|
||||
HostVO host = _hostDao.findById(hostId);
|
||||
if (host != null && host.getType() != null && !host.getType().isVirtual()) {
|
||||
if (s_logger.isDebugEnabled()) {
|
||||
s_logger.debug("agent (" + hostId + ") responded to checkHeathCommand, reporting that agent is " + status);
|
||||
s_logger.debug("checking if agent (" + hostId + ") is alive");
|
||||
}
|
||||
return status;
|
||||
Answer answer = easySend(hostId, new CheckHealthCommand());
|
||||
if (answer != null && answer.getResult()) {
|
||||
Status status = Status.Up;
|
||||
if (s_logger.isDebugEnabled()) {
|
||||
s_logger.debug("agent (" + hostId + ") responded to checkHeathCommand, reporting that agent is " + status);
|
||||
}
|
||||
return status;
|
||||
}
|
||||
return _haMgr.investigate(hostId);
|
||||
}
|
||||
|
||||
return _haMgr.investigate(hostId);
|
||||
return Status.Alert;
|
||||
}
|
||||
|
||||
protected AgentAttache getAttache(final Long hostId) throws AgentUnavailableException {
|
||||
|
|
|
|||
Loading…
Reference in New Issue