private void doWork() throws InvalidStateTransitionException, AmbariException {
List<Host> allHosts = fsm.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 = fsm.getHost(host).getLastHeartbeatTime();