private void doWork() throws InvalidStateTransitionException, AmbariException {
List<Host> allHosts = clusters.getHosts();
long now = System.currentTimeMillis();
for (Host hostObj : allHosts) {
String host = hostObj.getHostName();
HostState hostState = hostObj.getState();
String hostname = hostObj.getHostName();
long lastHeartbeat = 0;
try {
lastHeartbeat = clusters.getHost(host).getLastHeartbeatTime();