private boolean isChaosAgentRunning(String hostname) {
    try {
      return zk.exists(CHAOS_AGENT_PARENT_ZNODE + ZNODE_PATH_SEPARATOR + hostname, false) != null;
    } catch (KeeperException e) {
      if (e.toString().contains(CONNECTION_LOSS)) {
        recreateZKConnection();
        try {
          return zk.exists(CHAOS_AGENT_PARENT_ZNODE + ZNODE_PATH_SEPARATOR + hostname, false)
              != null;
        } catch (KeeperException | InterruptedException ie) {
          LOG.error("ERROR ", ie);
        }
      }
    } catch (InterruptedException e) {
      LOG.error("Error checking for given hostname: {} ERROR: ", hostname, e);
    }
    return false;
  }
Checks if ChaosAgent is running or not on target host by checking its ZNode.
@param hostname hostname to check for chaosagent
@return true/false whether agent is running or not
hbase-it/src/test/java/org/apache/hadoop/hbase/ChaosZKClient.java