SSH Sampler for Jakarta JMeter that executes commands (eg, iostat) over an SSH session, and returns the output. The output may then be parsed or logged by a listener for use elsewhere in the testing process. This repository is a fork of https://code.google.com/p/jmeter-ssh-sampler/ to manage pull reqests.
A second component deals with SFTP to allow you to download files over SSH to assert on their content.
Installation is fairly straightforward, and only involves adding the plugin and JSch to the right directory:
- Build with maven
- Place the jmeter-ssh-sampler jar file into JMeter's lib/ext directory
- Place JSch into JMeter's lib directory
- Run JMeter, and find "SSH Sampler" in the Samplers category
Using the plugin is simple (assuming familiarity with SSH and JMeter):
- Create a new Test Plan
- Add a Thread Group
- Add a Sampler > SSH Command
- Specify the host to connect to, port, username and password (unencrypted) or a key file, and a command to execute (such as date)
- Add a Listener > View Results Tree
- Run the test
- Create a new Test Plan
- Add a Thread Group
- Add a Sampler > SSH SFTP
- Specify the host to connect to, port, username and password (unencrypted) or a key file, and a SFTP command to execute (such as get)
- Specify a source file to download, an output file or to print the content in the test
- Add a Listener > View Results Tree
- Run the test
Maven retrieves the following dependencies:
- SSH functionality is provided by the JSch library
- JMeter 2.3+ is capable of running this plugin
- Fork it.
- Create a branch (
git checkout -b my_plugin
) - Commit your changes (
git commit -am "Added feature"
) - Push to the branch (
git push origin my_plugin
) - Create an [Issue][1] with a link to your branch
- Enjoy a refreshing Diet Coke and wait