execute a Linux command on a EC2 instance using Jmeter ssh sampler - jmeter

I’m trying to execute a Linux command from my local windows server to remote EC2 instance using Jmeter ssh sampler plug in ,what is the way to connect to ec2 with my private key file and send the command?

Follow next simple steps:
From JMeter SSH Sampler Releases page:
Download latest version of ApacheJMeter_ssh-x.x.x.jar and drop it to /lib/ext folder of your JMeter installation
Download jsch-x.x.x.jar and drop it to /lib folder of your JMeter installation
Restart JMeter to pick the jars up
Add SSH Command Sampler to your Test Plan - there will be "Client certificate" input section where you can specify private key and password if needed
See How to Run External Commands and Programs Locally and Remotely from JMeter guide for more detailed information on the topic.

Related

Jmeter failed to download plugins repository

I need to use jmeter on a working machine without internet access. I installed Apache Jmeter 5.2.1 myself, downloaded plugins-manager.jar and put it into lib / ext directory, then restarted JMeter.
But when I try to go to Jmeter -> Options -> Plugins Manager, I see this error:
If you need add Plugins(jars) to the system without Internet Connection you have to manually download them on another system with internet connect and then you can move the jars to
Jmeter (Folder)
|->Lib (Folder)
|->ext (Folder)
Paste the Jars into the ext folder and restart the Jmeter can solve the problem.
UnknownHostException means that the Plugins Manager is not able to get the address of the plugins repository.
Most probably your machine doesn't have direct Internet connection and requires a proxy in order to reach to the external hosts.
You need to configure JMeter to use your corporate proxy address, port and in some cases username and password, it can be done in 2 ways:
Via JMeter command-line arguments like:
jmeter -E https -H my.proxy.server -P 8000 -u username -a password -N localhost
Via system.properties file (located in "bin" folder of your JMeter installation):
http.proxyHost=my.proxy.server
http.proxyPort=8080
https.proxyHost=my.proxy.server
https.proxyPort=8080
JMeter Plugins Manager respects JMeter's proxy settings so given you're able to successfully execute HTTP Request samplers you should be able to download the plugins as well.
References:
Using JMeter behind a proxy
Apache JMeter Properties Customization Guide
Plugins Manager Network Configuration -> Using Behind the Proxy

I can't get 'create-rmi-keystore.bat' to run on windows, is there a solution to this?

I am new to Jmeter 5.1.1 however I am in the process of setting up a remote testing with it.
One step I'm having trouble with is running 'create-rmi-keystore.bat' when I double click it nothing happens. I have tried to open it using the command line and get the following message.
'keytool' is not recognized as an internal or external command,
operable program or batch file.
"Copy the generated rmi_keystore.jks to jmeter/bin folder or reference it in property 'server.rmi.ssl.keystore.file'"
I don't seem to have a rmi-keystore.jks .
Has anyone managed to solve this issue?
You don't have keytool utility in your Windows PATH, all you need to do is to ensure that it's there.
Solution using Windows Command Prompt would be:
set PATH="path\to\bin\folder\of\your\JDK\or\JRE\installation";%PATH%
In general if you don't need the secure RMI communication between JMeter master and slave machines (and 99% of people don't need this as it doesn't add any value and only creates overhead in terms of CPU and RAM) you can just disable this functionality by adding the next line to user.properties file:
server.rmi.ssl.disable=true
References:
Remote hosts and RMI configuration
Apache JMeter Properties Customization Guide
If you do this on JMeter master and all the slaves you will not have to worry about the RMI keystore, but I would still recommend having the keytool in the PATH otherwise you will not be able to use HTTP(S) Test Script Recorder for recording secure traffic.

How to run JMeter Webdriver samplers on a remote machine

I am trying to run JMeter Webdriver samplers in IE on a remote machine. I have changed remote_hosts to the IP address of the remote machine. JMeter server on the remote machine is also started. When I run the tests from the JMeter GUI on the local machine (Run->Remote Start menu) I can see the command line window in remote machine showing
"Started the test..."
and immediately
"Finished the test..."
So the test runs but nothing actually happens.
I must be missing some configuration.
Can someone please help?
You need to install the same Selenium/WebDriver Support plugin to the remote slave(s). This can be done either by copying the whole JMeter installation to the slave host(s) or using JMeter Plugins Manager on each slave.
You need to download Internet Explorer Driver binary and put it to the same location as on the master host.
In case of any problems check jmeter-server.log file on remote slave - normally it should contain the root cause (or clue on what is wrong)

Is it possible to login to Linux/AWS instance using ssh key in Jmeter?

Is it possible to login to Linux/AWS instance using ssh key in Jmeter?
We have to login to Linux system which has (login to the machines which are created using a public/private key) by using Jmeter and perform few actions.
Please guide.
Yes, You can accomplished this using SSH Command sampler.
Download plugin manager https://jmeter-plugins.org/install/Install/ and place the jar in your jmeter/lib/ext folder.
Open Jmeter >> Options >> Plugin Manager >>Install SSH Protocol Support
Restart Jmeter and add thread group, SSH command sampler and View result tree listener to your test plan
Enter the command you want to execute under command section and check the result in the listener.

Jmeter server.bat file error

Please give me solution for the below error.
Could not find ApacheJmeter_core.jar ... ... Trying JMETER_HOME=.. Found ApacheJMeter_core.jar Created remote object: UnicastServerRef [liveRef: [endpoint:192.168.8.108:50019 ,objID:[-30cb105c:15ca098204b:-7fff, 5736149660821635846]]]
I tried the below way also, am not able to launch
"I just hard coded the path in my jmeter_server.bat."
Am doing testing now.. if any one knows please update here.
This is not an error at all, it means that you successfully launched a JMeter slave which is now waiting for a command from the JMeter master.
So now you need to start JMeter Master using one of the following approaches:
Pass slave IP address via -R command-line argument like:
jmeter -R 192.168.8.108 -n -t test.jmx -l result.jtl
Define remote_hosts JMeter Property by adding the next line to user.properties file on JMeter Master node:
remote_hosts=192.168.8.108
References:
JMeter Distributed Testing Step-by-step
Apache JMeter Properties Customization Guide
If you need just to open JMeter GUI you will need to launch jmeter.bat script or alternatively directly call java from JMeter's "bin" folder like:
java -jar ApacheJMeter.jar

Resources