Script to carry-over the script execution to another system


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Script to carry-over the script execution to another system
# 1  
Old 05-28-2009
Error Script to carry-over the script execution to another system

The situation is like this.

If I need to know the parameters of all the unix servers connected to a common network, is it possible to get all the parameter details of all the system with the help of a script written in one server??

Can a script be written like that ?

Let me give some more insight in to this.

Say, I login to a system, from that system I write a script to login to other servers by doing SSH to IP addresses of those servers stored in a file, execute the commands in that server environment and return the parameter details to the parent server from where I executed the script initially.

In simple words, If I include a SSH command and IP addresss in a script, is it possible for the remaining commands to be executed in the new server environment (to which I 'SSH'ed to.. )rather than in the same server where I wrote the script.

Your ideas are most welcome.
# 2  
Old 05-28-2009
Code:
command="hostname; vmstat"
while read ipaddress 
do
     ssh me@"$ipaddress" "$command"
done < ip_file > output_of_commands

Is this what you mean?
where ip_file looks lile
Code:
20.20.20.10 
20.20.20.11

# 3  
Old 05-28-2009
thanks for your reply..

What I need is like, it should execute the commands in another server ,get the output of the commands and return back to the server from where I executed the script initially , so that I can do the same for other servers. Can that output be directed or appended back to a single file in the first server which I can use to compare the parameters of all the set of servers in that network.

Moreover, where do we get to enter the password in the above script.

I hope I made it clear.
# 4  
Old 05-29-2009
You can use expect or run as per the script above and store the output in a file and then ftp the file to the server
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell script to call Oracle archive backup script when file system reaches threshold value

Hello All, I need immediate help in creating shell script to call archivebkup.ksh script when archive file system capacity reaches threshold value or 60% Need to identify the unique file system that reaches threshold value. ex: capacity ... (4 Replies)
Discussion started by: sasikanthdba
4 Replies

2. Solaris

Script on Solaris spawning 2 processes for one shell script execution

Hi, I am having a shell script on Solaris 10 which has a while loop as shown below. #!/usr/bin/ksh # while do sleep 60 done Name of the shell script is coldcentric.sh. I executed script /DATAWAREHOUSE/LOAD/Scripts/coldcentric.sh from a command task in Informatica worklow as... (3 Replies)
Discussion started by: chekusi
3 Replies

3. Emergency UNIX and Linux Support

invoke one script based on previous script execution

I am database guy and not very good at shell scripts. I am seeking help to sharp my script coding. I have 5 scripts 1. master script. I use this one to call other four scripts to do database work. 2. db_backup_1 and log_backup_1 3. db_backup_2 and log_backup_2 in master script, I want to... (4 Replies)
Discussion started by: duke0001
4 Replies

4. UNIX for Advanced & Expert Users

SSH using shell script terminates the script execution

Hello, I am writing a shell script in which i do ssh to remote server and count the number of files there and then exit. After the exit the shell script terminates which i believe is expected behavior. Can some one suggest me a way where even after the exit the script execution resumes. ... (2 Replies)
Discussion started by: manaankit
2 Replies

5. Shell Programming and Scripting

Script Execution

Hello all, I generally get 6 or more files at location /usr/example.Files listed below er 1 2 3 9.txt er 2 2 3 9.txt er 3 2 3 9.txt er 4 2 3 9.txt abc.next del pa.txt cr ad.txt ps tr as er.txt Now the issue is i need to transfer 2 files (one file is fixed called abc.next) at a... (12 Replies)
Discussion started by: j_panky
12 Replies

6. Shell Programming and Scripting

Running a script in system() call and want the script's output

Hi All, I have a script(sample.sh) displaying the output of "dd" command. Now i am using this script in system() call as, system("sh sample.sh") in an application file. I want the output of system("sh sample.sh") in the application file itself. How can i get it? Many thnaks.... (9 Replies)
Discussion started by: amio
9 Replies

7. Shell Programming and Scripting

Run script from another script if system date was reached

I what to find a system date in a shell script and search for it in a file in specific record. If the record (ENDC) has the same date I what to execute another shell script. Here is example of the file: Can someone please help me with this ? (3 Replies)
Discussion started by: Lenora2009
3 Replies

8. Shell Programming and Scripting

Perl script 'system' linking to local shell script not working

Trying to figure out why this works: printpwd.pl #!/usr/bin/perl use CGI::Carp qw( fatalsToBrowser ); print "Content-type: text/html\n\n"; $A = system("pwd"); $A = `pwd`; print "$A\n"; ^^actually that works/breaks if that makes any sense.. i get the working directory twice but when... (5 Replies)
Discussion started by: phpfreak
5 Replies

9. Shell Programming and Scripting

help on script execution

Hi, Please help me on the below code of line of what it actually does ${Script_dir}/scrip1.sh & export script1_pid=$! ${Scipt_dir}/script2.sh & export script2_pid=$! ${Scrip_dIR}/script3.sh & export script3_pid=$! wait ${script1_pid} //could u tell me wht this... (8 Replies)
Discussion started by: sussane
8 Replies

10. AIX

stop execution of script with in the script

Hello i want to incorporate of piece of code in the shell script which checks whether same script is already running or not. If it is already running i want to come out (exit) if its not then continue with the execution of the script. Any help would be very much appreciated Thanks (3 Replies)
Discussion started by: dsdev_123
3 Replies
Login or Register to Ask a Question