Examples of execCmd()


Examples of com.vmware.bdd.utils.SSHUtil.execCmd()

      String cmd = "sudo " + script;
      boolean succeed = false;
      SSHUtil sshUtil = new SSHUtil();
      for (int i = 0; i < Constants.SET_PASSWORD_MAX_RETRY_TIMES; i++) {
         try {
            succeed = sshUtil.execCmd(sshUser, privateKeyFile, nodeIP, sshPort, cmd, null, null);
            if (succeed) {
               logger.info("Remove ssh limit for " + nodeIP + " succceed");
               return true;
            }
         } catch (JSchException e) {
View Full Code Here

Examples of com.vmware.bdd.utils.SSHUtil.execCmd()

      boolean setPasswordSucceed = false;
      int jschExceptionCount = 0;
      for (int i = 0; i < Constants.SET_PASSWORD_MAX_RETRY_TIMES; i++) {
         try {
            SSHUtil sshUtil = new SSHUtil();
            setPasswordSucceed = sshUtil.execCmd(sshUser, privateKeyFile, nodeIP, sshPort, cmd, in, null);
         } catch (JSchException e) {
            if (++jschExceptionCount == Constants.SET_PASSWORD_MAX_RETRY_TIMES) {
               throw SetPasswordException.GOT_JSCH_EXCEPTION_WHEN_SET_PASSWORD(e, nodeIP);
            }
         }
View Full Code Here

Examples of com.vmware.bdd.utils.SSHUtil.execCmd()

      String cmd = "ps aux | grep " + ttyName + " | grep -v \"grep\" | awk '{print $2}' | sudo xargs kill -9";
      SSHUtil sshUtil = new SSHUtil();
      //if refresh failed, user still can manually refresh tty by Ctrl+C, so don't need to check whether
      //it succeed or not
      try {
         boolean refreshTtySucceed = sshUtil.execCmd(sshUser, privateKeyFile, nodeIP, sshPort, cmd, null, null);
         logger.info("Refresh " + ttyName + " on " + nodeIP + (refreshTtySucceed ? "succeed" : "failed") + ".");
      } catch (JSchException e) {
         logger.error("Got exception when refresh tty on " + nodeIP, e);
      }
   }
View Full Code Here

Examples of com.vmware.bdd.utils.SSHUtil.execCmd()

      logger.info(action + " command is: " + cmd);
      SSHUtil sshUtil = new SSHUtil();
      String errMsg = null;
      for (int i = 0; i < Constants.SET_PASSWORD_MAX_RETRY_TIMES; i++) {
         try {
            if (sshUtil.execCmd(sshUser, privateKeyFile, nodeIP, sshPort, cmd, null, null)) {
               logger.info(action + " succeed.");
               return;
            }
         } catch (JSchException e) {
            logger.warn("Got exception when " + action, e);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.