Jmeter failed to download plugins repository - jmeter

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

Related

Jmeter cannot find keytool application and no keystore was provided. Tried alll

Im working with Jmeter, trying to running it as a proxy, but when I start recording, I got this alert. I tried setting user.properties, but i can’t find a solution. Please, so grateful if you help me!
In order to be able to record HTTPS traffic JMeter generates special MITM certificate which needs to be installed in the browser
In order to be able to generate the certificate JMeter needs keytool command which normally lives in "bin" folder of JDK or JRE
So make sure to add the "bin" folder of your Java installation to your operating system PATH and it should resolve your issue.
Example command on Windows:
setx PATH=c:\java\bin;%PATH% && jmeter.bat
Example command on Unix and derivatives:
PATH=/opt/java/bin:$PATH && ./jmeter.sh
Replace c:\java or /opt/java with the real path to your JDK or JRE installation.
You should get something like:
if you launch JMeter from the same terminal window you will be able to start the HTTP(S) Test Script Recorder without any issues
Also be aware that there is an easier way of recording a JMeter test: JMeter Chrome Extension, in this case you won't have to worry about proxies and SSL certificates

JMeter - Add Client side Certificate and key

How can we add a client-side certificate and key to JMeter Script?
Every time I'm navigating to JMeter -> Options -> SSL Manager and browsing the Certificate and entering the password then it's only allowing me to run the script successfully, else I'm getting the forbidden error access denied.
I have tried the below steps, but still facing the same issue:
Added below lines in JMeter properties:
javax.net.ssl.keyStoreType=pkcs12
javax.net.ssl.keyStore=C:\certs\mycert.p12
javax.net.ssl.keyStorePassword=password
Tried using the JSR223 Sampler in JMeter script but still no luck.
Thanks in advance.
Forget about jmeter.properties file, any customization of JMeter Properties should be done in user.properties file or in a separate copy of jmeter.properties which needs to be passed to JMeter via -p command-line argument
In your case you're trying to change System Properties so you need to put these lines to system.properties file
JMeter restart will be required to pick the properties up
More information:
Configuring JMeter
How to Set Your JMeter Load Test to Use Client Side Certificates

Jmeter Proxy giving 504 gateway timeout error

I have URL which is like this:
https://110.111.72.72:8001?id=username1
when I use the same URL in browser it works fine and return a result but when I use the same in Jmeter I get a 504 Gateway Timeout error.
In my organisation we do have the proxy which I have mentioned in the browser LAN -> proxy server settings.
I have tried many things but none worked please help.
You need to configure JMeter to use the same proxy server your browser is using. It can be done in 2 ways:
Via command-line arguments. In this case you will need to run JMeter as:
jmeter -H your_company_proxy_host -P your_company_proxy_port-u username -a password
Via Java System Network Properties. In this case you will need to add the following lines to system.properties file (located in "bin" folder of your JMeter installation)
http.proxyHost=your_company_proxy_host
http.proxyPort=your_company_proxy_port
https.proxyHost=your_company_proxy_host
https.proxyPort=your_company_proxy_port
More information:
Using JMeter behind a proxy
Apache JMeter Properties Customization Guide
Thanks Dmitri T
jmeter -H your_company_proxy_host -P your_company_proxy_port-u username -a password ---- Worked Fine
I didn't try the 2nd option.
Thanks for solving another

Jmeter- how to include external .p12 SSL certificate

exception Jmeter throws-
javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
at com.ibm.jsse2.qc.a(qc.java:422)
at com.ibm.jsse2.qc.h(qc.java:714)
at com.ibm.jsse2.qc.a(qc.java:831)
at com.ibm.jsse2.qc.startHandshake(qc.java:828)
at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:553)
at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:412)
at org.apache.jmeter.protocol.http.sampler.LazySchemeSocketFactory.connectSocket(LazySchemeSocketFactory.java:97)
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:179)
at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:328)
at org.apache.jmeter.protocol.http.sampler.MeasuringConnectionManager$MeasuredConnection.open(MeasuringConnectionManager.java:114)
Is there any specific Java version need to be used?
Jmeter version is - 3.1
Just add the next lines to system.properties file (located in the "bin" folder of your JMeter installation)
javax.net.ssl.keyStoreType=pkcs12
javax.net.ssl.keyStore=/path/to/your/certificate.p12
javax.net.ssl.keyStorePassword=your_certificate_password_here
Another option is providing the aforementioned properties via -D command-line argument like:
jmeter -Djavax.net.ssl.keyStoreType=pkcs12 -Djavax.net.ssl.keyStore=/path/to/your/certificate.p12 -Djavax.net.ssl.keyStorePassword=your_certificate_password_here
This is more convenient for unattended executions, i.e. using Continuous Integration servers
Restart JMeter to pick the properties up
Now JMeter will be using your client certificate for requests encryption
See How to Set Your JMeter Load Test to Use Client Side Certificates for more details.
Alternatively you can use SSL Manager, however personally I consider using system properties more convenient.

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

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.

Resources