LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 11-13-2010, 07:28 AM   #1
Vijayababu
LQ Newbie
 
Registered: Nov 2010
Posts: 3

Rep: Reputation: 0
Question how to start script at remote host


Hi all, i want to start a shell scripts(which generate traffic to test my network) at remote linux hosts from single linux local host.. If i start script at remote host through ssh, all traffic are sending from my local host also. It will create burden on my local host. If i terminate SSH connection, it stopping the script at remote host. Also i need to do ssh to all my remote hosts.

Is there any best way to do it?
 
Old 11-13-2010, 07:29 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,378

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
nothing to do with networking. moved to Linux - Newbie.

As far as your question goes, for the part about it terminating remotely on disconnect, then that's something "screen" is very useful for, check that out. The first things you mention I don't really understand. How does all the traffic come over ssh??

Last edited by acid_kewpie; 11-13-2010 at 07:31 AM.
 
Old 11-15-2010, 09:07 AM   #3
rylan76
Senior Member
 
Registered: Apr 2004
Location: Potchefstroom, South Africa
Distribution: Fedora 17 - 3.3.4-5.fc17.x86_64
Posts: 1,475

Rep: Reputation: 87
Why not use cronjobs on your remote hosts to start the network traffic you want?

That should make any traffic emanate FROM the remote systems, not your local system.
 
Old 11-23-2010, 07:44 PM   #4
Vijayababu
LQ Newbie
 
Registered: Nov 2010
Posts: 3

Original Poster
Rep: Reputation: 0
Thanks you rylan76.

I tried cronjob but no success as cronjob is new for me. i added entry in crontab like
1 * * * * /usr/local/bin/script.sh (i kept script in /usr/local/bin folder and in script i'm just opening "xterm -e ping 192.168.x.x" . here in remote host what i want is , open xterm and ping from that.

but when give reboot in crontab (1 * * * * /sbin/reboot), system rebooted properly. any suggestion here.

Thanks in advance.
 
Old 11-23-2010, 08:13 PM   #5
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,965
Blog Entries: 11

Rep: Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865
The problem is most likely the xterm. Why do you feel
you need to fire up a gui element to issue a ping?

Also: what's the goal of the exercise?



Cheers,
Tink
 
Old 11-23-2010, 09:55 PM   #6
smart_shell
Member
 
Registered: May 2009
Location: NYC
Distribution: Ubuntu 10.04 LTS
Posts: 52

Rep: Reputation: 0
Quote:
Originally Posted by Vijayababu View Post
Hi all, i want to start a shell scripts(which generate traffic to test my network) at remote linux hosts from single linux local host.. If i start script at remote host through ssh, all traffic are sending from my local host also. It will create burden on my local host. If i terminate SSH connection, it stopping the script at remote host. Also i need to do ssh to all my remote hosts.

Is there any best way to do it?
How to start script at remote host.
1. U can using "NC" TCP/UDP listner http://linux.die.net/man/1/nc (nc -l 1234 > filename.out )
2. Cron started every min your (shell script) and looks file output. Reads command from file, clears file(echo -n > filename.out)
3. if there is something then start your traffic script.
thnx

Last edited by smart_shell; 11-23-2010 at 10:09 PM.
 
Old 11-24-2010, 07:58 PM   #7
Vijayababu
LQ Newbie
 
Registered: Nov 2010
Posts: 3

Original Poster
Rep: Reputation: 0
Thanks for reply..
my setup model is like below,

|-----[H2]----> internet
|
[H1]-|-----[H3]----> internet
|
|-----[H4]-----> internet

my goal is i need to start traffic like ftp, http, ping , iperf from H2, H3, H4 to destination hosts on internet.

So i want to achieve it from H1. so i'm keeping some scripts for traffic mention above on H2, H3, H4 and starting those scripts from H1.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
bash script recording remote host output? ieatbunnies Linux - Software 4 07-21-2010 12:23 PM
ssh - using variables in call to start remote script from local script babag Linux - Networking 2 06-03-2008 04:50 PM
running script on a remote host p_test Programming 5 10-02-2006 03:40 PM
Logging into a remote host automatically through shell script patil_reddy Red Hat 1 06-13-2006 06:23 AM
remote host connection script question??? gopi_20us Programming 4 03-01-2002 04:04 PM


All times are GMT -5. The time now is 05:41 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration