How can I perform a loadtest, using Silk Performer, whilst using SSH for client/server authentication?
OpenSSH is a FREE version of the SSH protocol suite of network connectivity tools that increasing numbers of people on the Internet are coming to rely on. Many users of telnet, rlogin, ftp, and other such programs might not realize that their password is transmitted across the Internet unencrypted, but it is. OpenSSH encrypts all traffic (including passwords) to effectively eliminate eavesdropping, connection hijacking, and other network-level attacks. Additionally, OpenSSH provides a myriad of secure tunneling capabilities, as well as a variety of authentication methods.
The main site for SSH on the web is:
http://www.openssh.com/ - please refer to this for exact setup details.
Once setup on the server side, the Sshd (daemon) can be seen running.
To connect from the client side, a client tool will have to be installed and then called as an external process. This can be, for example
PuTTY (the Telnet and SSH client itself)
Plink (a command-line interface to the PuTTY back end)
The following example uses the client side connection program Plink.exe. This will then be called as an external process using the ProcessInitialize and ProcessStart functions. The .exe file should be imported as a data file to the Silk Performer Project.
The script randomizes 5 server logins, using the Project Attribute settings and then executing a "vmstat 1 2 | tail +4" command which will gather counters for virtual memory utilization.
The initial Silk Performer Project attribute settings can be located in Silk Performer at PROJECT | PROJECT ATTRIBUTES.
// SSH/Loadtest for Solaris logins
// This SilkEssential script for Solaris allows multiple logins via a SSH connection.
// SSH is used to connect to the system in a secure way,
// using the PuTTY command line tool.
// NOTE: You must FIRST test the SSH connection manually on the
// command line, because PuTTY needs to establish trust
// with the SSH server. Public key may need to be set-up as well.
// please see: http://www.chiark.greenend.org.uk/~sgtatham/putty/
// NOTE: The Host ,UserName and Password need to be changed for each system via
// the project attributes settings in the above menu bar.
rNum : RndUniN (1..5); dcluser
TMain : 5;
ARRAY_SIZE := 22;
CONST_TIMEOUT := 120;
hFile : number;
hProcessId : number;
sDataDir : string;
sResultDir : string;
sPlink : string;
sCommand : string(1024);
sStdout : string;
sStderr : string;
sSSH : string;
sHost : string;
sPassword : string;
sUsername : string;
sVerbose : string;
sAddNo : number;
begin // get the location of Plink.exe
GetDataFilePath("plink.exe", sDataDir, sizeof(sDataDir));
GetDirectory(DIRECTORY_RESULT, sResultDir, sizeof(sResultDir));
// suppress FOpen warnings on using absolute paths
ErrorAdd(FACILITY_RESERR, 1014, SEVERITY_INFORMATIONAL);
sAddNo := rNum;
//Get Project Attributes
AttributeGetString("Host", sHost, sizeof(sHost));
AttributeGetString("Username", sUsername, sizeof(sUsername));
sUsername := sUsername + string(sAddNo);
//halt ; AttributeGetString("Password", sPassword, sizeof(sPassword));
sPassword := sPassword + String(sAddNo);
if AttributeGetBoolean("Verbose") then
sVerbose := " -v ";
sVerbose := "";
end; if AttributeGetBoolean("SSH") then
sSSH := " -ssh ";
sSSH := "";
if sPassword <> "" then
sPassword := " -pw " + sPassword + " ";
sPlink := sDataDir;
sCommand := sSSH+sVerbose+sPassword+sUsername+"@"+sHost+" vmstat 1 2 | tail +4";
sStdout := sResultDir+"sshout.txt";
sStderr := sResultDir+"ssherr.txt"; // Create process and start it up...
hProcessId := ProcessInitialize(sPlink, PROCESS_ATTACHED, sCommand, "", sStdout, sStdErr, CONST_TIMEOUT);