I'm using Jmeter to load test our application. I have the application running in a server. I've the "Server Agent" running in my server listening on port 4444. From my local machine, the 'PerfMon' listener is not able to connect to the server (The telnet connection to the port 4444 of the server isn't connecting as well). I came to know that the port 4444 in my server will not be accessible from external IP. And the only solution is to ssh tunnel & port forwarding. I used the following syntax (local-to-remote tunnel):
ssh -L "Local Port":Server IP:4444 User@host
The above didn't work. I'm suspecting that the "Local Port" I'm providing is wrong. How do I know from which port the JMeter from my local machine is connected to? Or am I altogether wrong?
let's say the tested app is running on server named foo.bar (or use the server's IP address). Then, create the tunnel like this:
ssh -L 4444:localhost:4444 [email protected]
Your local 4444 port will forwarded on 4444 on foo.bar.
Read more about port tunneling at SSH Tunnel - Local and Remote Port Forwarding Explained With Examples.