public SystemInformation GetSystemInformationFrom(TargetInfo target) { var hostAddress = target.GetAddress(); var username = target.credentials.GetUserName(); var password = target.credentials.GetPassword(); var commandRunner = new SshCommandLineRunner(hostAddress, username, password, target.GetPort()); var collectedUnixSystemInformation = SystemInformationCollector.getSysInfo(commandRunner); return CreateSystemInformationInstance(collectedUnixSystemInformation); }
public SystemInformation GetSystemInformationFrom(TargetInfo target) { var hostAddress = target.GetAddress(); var username = target.credentials.GetUserName(); var password = target.credentials.GetPassword(); var commandRunner = new SshCommandLineRunner(hostAddress, username, password, target.GetPort()); var collectedUnixSystemInformation = SystemInformationCollector.getSysInfo(commandRunner); return(CreateSystemInformationInstance(collectedUnixSystemInformation)); }
public virtual void Connect(TargetInfo target) { this.SshCommandLineRunner = CreateSshCommandLineRunner(target); try { this.SshCommandLineRunner.Connect(); } catch (Exception ex) { throw new SshConnectingException( string.Format( "Unable to connect to target machine {0} through port {1} using the user {2}. Check the target address (or host name), port number and that ssh service is running at target machine. Error Message: '{3}'", target.GetAddress(), target.GetPort(), target.credentials.GetFullyQualifiedUsername(), ex.Message)); } }