0
votes

OS: Mac OS Sierra

So I installed Jmeter and SSH sampler plugin. I want to access api host to send execute command on it via ssh. I am able to connect to this host via ssh using my ssh key, but can't do the same using Jmeter SSH Sampler.
Keep getting:

'Failed to connect to server: timeout: socket is not established'

.

Currently I'm out of ideas, how would I achieve this? Are there any peculiarities or additional settings I'm missing?
Adding screens with settings. I am filling in IP address of host, which I can access, just can't publish it.
The key is in OpenSSH format.

response_screen sampler_settings

2

2 Answers

1
votes

Remote Commands: Linux/MacOSX

Linux, Unix and MacOSX operating systems can be remotely accessible (in majority of cases) through SSH (Secure Shell) protocol. To accomplish that we can use the JMeter SSH Sampler plugin.

Installation:

  1. Download ApacheJMeter_ssh-x.x.x.jar and jsch-x.x.x.jar from the SSH Sampler Releases page.
  2. Drop Apache_JMeter_ssh-x.x.x.jar to /lib/ext folder of your JMeter installation.
  3. Drop jsch-x.x.x.jar to /lib folder of your JMeter installation.
  4. Restart JMeter.
  5. You should see 2 new Samplers: SSH Command and SSH SFTP.
0
votes
  1. Your login can fail due to DDS key being rejected. As per OpenSSH 7.0 release notes:

    • Support for ssh-dss, ssh-dss-cert-* host and user keys is disabled by default at run-time. These may be re-enabled using the instructions at http://www.openssh.com/legacy.html

    Alternatively you can specify path to id_rsa private key file

  2. I don't think SSH Command sampler understands ~ shorthand, you should be providing full path to your SSH private key

  3. You have to provide your SSH username as well
  4. In any case make sure you can reach the port 22 of the machine where the SSH server is running from the machine where JMeter is running.

More information: How to Run External Commands and Programs Locally and Remotely from JMeter