What command to use to transfer file from one server to another server - jmeter

I want to automate the process of transferring files between servers that is done using WinSCP. Can we automate this process through jmeter using OS process sampler. Please help me with the command to transfer files and how to connect to servers using jmeter and transfer files.

Use Jmeter Plugin jmeter-ssh-sampler for this:
And then can use SCP command to transfer file from one server to another server.
To copy a file from a local to a remote system run the following command:
Commad : scp file.txt remote_username#10.10.0.2:/remote/directory
Below is the link to the plugin:
jmeter-ssh-sampler link

Related

How to find out the port on which my PowerShell script is communicating to the other server?

I have a PowerShell script which copies certain files from a remote server and pastes in the local server. Now I need to use the file from another agent server which doesn't have connectivity to the remote server.
So I need to find out the port on which the communication will be established to the remote server from the agent server to copy the data.
I tried using netstat command but didn't find anything in that.
What are the steps to be followed to get the port information?

How to download files from a FTP using PhantomJS

I have a file on a FTP Server. I´m trying to download it using PhantomJS. I´ve tried using the following code:
var page = require('webpage').create();
page.open('ftp://USERNAME:PASSWORD#www.mywebsite.com/exempleFIle.xlsx');
phantom.exit();
It runs without throwing any errors, however the file is not downloaded. Is it possible to download it with PhantomJS?
My main goal is synchronizing the files in the FTP with my computer, so I can put it in my Google Drive and from there using it in my reports. I use PhantomJS to access some webpages and get some data for the same purpose. Since I´m already using PhantomJS, I thought I could do the same for the ftp server, but if there is a simpler solution that use other methods, I´m open to trying it.
Thank You
PhantomJS is a headless web-browser, it's not an FTP client, so it won't be able to help you.
My main goal is synchronizing the files in the FTP with my computer
I'd suggest using lftp.
lftp -u user,password -e 'mirror /remote/server/files/ /local/computer/files/' ftp.myserver.com
This will get files from the remote server to the local computer.

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.

Run batch scripts on a remote server (windows) from jenkins

I've got a continuous integration server (Jenkins ) which builds my code (checks for compilation errors) and runs tests and then deploys the files to a remote server (not a war file, but the actual file structure) I do this with a Jenkins plugin which allows me to transfer files via samba, it does this nightly.
Now, what I need to do is run an ant command on the remote server. And after that I need to start the application server on the remote server, the application server is started by running a .bat file from the command line.
I'm pretty clueless how to accomplish this, I know Jenkins is capable of running batch commands, but how do I make them run in the context of the server and not the context of the build server?
If Jenkins on Windows, remote on *nix, use plink.exe (which is essentially command line PuTTy)
If Jenkins on Windows, remote on Window, use psexec.exe
If Jenkins on *nix, remote on *nix, use ssh
If Jenkins on *nix, remote on Windows, (update 2015-01) Ansible http://docs.ansible.com/intro_windows.html has support for calling Windows commands, eg powershell, from a unix/linux machine, https://github.com/ansible/ansible-examples/blob/master/windows/run-powershell.yml
Tell me what OSes are involved (both on Jenkins and remote), and I will flash this out further.
Edit:
The download page for psexec.exe lists all command line options. You will want something along the lines of:
psexec \\remotecomputername -u remoteusername -p remotepassword cmd /c <your commands here>
Replace <your commands here> with actual commands as you would execute them from command prompt.
Note that psexec first needs to install a service, and required elevated command prompt/admin remote credentials to do so.
Also, you need to run psexec -accepteula once to accept the EULA prompt.
Following Slav's answer above, here is a simpler solution for Jenkins (*nix) to remote (windows):
Install an SSH server on your remote windows (MobaSSH home edition worked well for me)
Make sure your Jenkins user, on your Jenkins machine, has the required certification to open an SSH connection with your remote (you can simply open a terminal and ssh to your remote once, then accept the certification. Make sure it is saved for the Jenkins user).
You can now add an execute shell build phase in your Jenkins job which can SSH to your remote windows machine.
Notes :
The established connection might require some additional work - you might have to set windows environment variables or map network drivers in order for your executed commands or batch files to work properly on your windows machines.
If you wish to run GUI related operations this solution might not be relevant (Following my work on running automation tests which require GUI manipulation).
Using Jenkins SSH plugin is an issue, as seen here.
1、i install (MobaSSH home ) on my remote windows server .
2、and install jenkins ssh plugin
3、edit shell eg: go build project
4、it seems something wrong ,
" go: creating work dir: CreateFile C:\WINDOWS\system32\bsh\tmp: The system cannot find the path specified."
I ended up going with a different approach after trying out psexec.exe for a while.
Psexec.exe and copying files over the network was a bit slow and unstable, especially since the domain I work on has a policy of changing password every months (which broke the build).
In the end I went with the master/slave approach, which is faster and more stable. Since I don't have to use psexec.exe and don't have to copy files over the network.

push file to remote system through telent using ruby

I have a remote embedded system which it is telnet-able. How can I download a binary file from the host to it? I can read file from the system, but have no idea how to write to it.
you probably want to do this with ftp
If there is no ftp server on the target system try using kermit

Resources