private void updateStatus(BSHostStatus status, String statusCode) {
    
    status.setStatusCode(statusCode);
    
    int reason = -1;
    try {
      reason = Integer.parseInt(statusCode);
    } catch (Exception ignored) {
    }
    
    switch (reason) {
    // case X: (as we find them)
    case 2:
      status.setStatusAction("Processing could not continue because the file was not found.");
      break;
    case 255:
    default:
      if (null != status.getLog()) {
        String lowerLog = status.getLog().toLowerCase();
        if (-1 != lowerLog.indexOf("permission denied") && -1 != lowerLog.indexOf("publickey")) {
          status.setStatusAction("Use correct SSH key");
        } else if (-1 != lowerLog.indexOf("connect to host")) {
          status.setStatusAction("Please verify that the hostname '" + status.getHostName() + "' is correct.");
        }
      }
      break;
    }
    
  }
Runnable class that gets the hoststatus output by looking at the files
in a certain directory. Only meant to be useful for bootstrap as of now.
ambari-server/src/main/java/org/apache/ambari/server/bootstrap/BSHostStatusCollector.java