Having problems with your account or logging in?
A lot of changes are happening in the community right now. Some may affect you. READ MORE HERE

How can I perform a loadtest, using Silk Performer, whilst using SSH for client/server authentication?

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)
or
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.

//////////////////Example script///////////////////////

// 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.
//
//

benchmark SSHLoadtest
use "kernel.bdh"

dclrand
rNum : RndUniN (1..5); dcluser
user
SshVmstat
transactions
TMain : 5;

dcltrans
transaction TMain
const
ARRAY_SIZE := 22;
CONST_TIMEOUT := 120;
var
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;
sPass :string;


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);

// FDelete(sResultDir+"sshout.txt");
// FDelete(sResultDir+"ssherr.txt");
sAddNo := rNum;

//Get Project Attributes
AttributeGetString("Host", sHost, sizeof(sHost));
AttributeGetString("Username", sUsername, sizeof(sUsername));
sUsername := sUsername + string(sAddNo);
print (sUsername);
//halt ; AttributeGetString("Password", sPassword, sizeof(sPassword));
sPassword := sPassword + String(sAddNo);
print (sPassword);
// halt;
if AttributeGetBoolean("Verbose") then
sVerbose := " -v ";
else
sVerbose := "";
end; if AttributeGetBoolean("SSH") then
sSSH := " -ssh ";
else
sSSH := "";
end;

if sPassword <> "" then
sPassword := " -pw " + sPassword + " ";
end;

sPlink := sDataDir;
Print(sPlink);
sCommand := sSSH+sVerbose+sPassword+sUsername+"@"+sHost+" vmstat 1 2 | tail +4";
print(sCommand);
sStdout := sResultDir+"sshout.txt";
sStderr := sResultDir+"ssherr.txt"; // Create process and start it up...
hProcessId := ProcessInitialize(sPlink, PROCESS_ATTACHED, sCommand, "", sStdout, sStdErr, CONST_TIMEOUT);
ProcessStart(hProcessId);
end TMain;

 

DISCLAIMER:

Some content on Community Tips & Information pages is not officially supported by Micro Focus. Please refer to our Terms of Use for more detail.
Top Contributors
Version history
Revision #:
1 of 1
Last update:
‎2013-02-15 18:59
Updated by:
 
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.