Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

rsh command

Status
Not open for further replies.

ShannonHI

Technical User
Dec 13, 2001
1
US
Unable to get rsh executed in loop correctly?

We are developing a monitoring script that uses rsh to login to our servers to check if a process based on log file has completed by set time and to check health of systems. The script executes a health check on remote server and writes to consolidated file. The script is successful if we execute the rsh calls directly in file such as
rsh server1 check_server.ksh >> outfile 2>&1
rsh server2 check_server.ksh >> outfile 2>&1 . . .

However, if we read a file with all the servers and execute the rsh the script only does the first rsh to server and ignores others. When we take the rsh command out, we replace with echo $server which prints out correctly all servers in file.

cat $file | while read server
do
echo $server
rsh $server check_server.ksh >> outfile 2>&1
done

Any ideas to help us why rsh will not work in loop?

Thanks


 
what is in check_server.ksh? does it end with an exit? Mike
michael.j.lacey@ntlworld.com
Email welcome if you're in a hurry or something -- but post in tek-tips as well please, and I will post my reply here as well.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top