writing a script that executes commands on two different servers.

writing a script that executes commands on two different servers.

Post by Armand Verstappe » Wed, 28 May 1997 04:00:00



When we change a password for a user (I work with an Internet Provider)
we have to:

rlogin to our password-server,
rsudo rpassword 'nodename'
answer to the cryptocard dialog,
set a new password.
exit the password-server,back to 'kantoor'-server,
vile /home/support/changes
append a log-line to changes,
exit vile.

I've been asked to automate this in a script, so that one command would do
the login to the server, issue de rsudo etc. command, logout of the server
and start-up vile.

problem is: I haven't found a way to tell rlogin to issue a command on the
server just logged onto, and rsh doesn't allow interactive commands, and
both rsudo and vile are interactive.

I hope and believe that there is a simple solution to this, but I haven't
found this in the manpages for rlogin or rsh.

suggestions?

Armand A.Verstappen     (Technical Support)
Demon Internet Amsterdam

 
 
 

writing a script that executes commands on two different servers.

Post by Icarus Spar » Wed, 28 May 1997 04:00:00




>When we change a password for a user (I work with an Internet Provider)
>we have to:

>rlogin to our password-server,
>rsudo rpassword 'nodename'
>answer to the cryptocard dialog,
>set a new password.
>exit the password-server,back to 'kantoor'-server,
>vile /home/support/changes
>append a log-line to changes,
>exit vile.

>I've been asked to automate this in a script, so that one command would do
>the login to the server, issue de rsudo etc. command, logout of the server
>and start-up vile.

The correct way of automating something like this is to use 'expect', which
can drive both the 'rlogin' and the 'vile' if needed, prompting for information
as required. Mind you I would suggest that if you are using a script then
just appending a line to /home/support/changes using 'echo' rather than
using an editor seems like a good idea.

Icarus

 
 
 

writing a script that executes commands on two different servers.

Post by Ramesh Nataraja » Wed, 28 May 1997 04:00:00


Hi,

Did you include the command to be executed in the .profile. Does it
help?

Bye, nram
--
Ramesh Natarajan :           http://members.tripod.com/~nram

In a world without fences, who needs Gates ? -Java 97 slogan

 
 
 

writing a script that executes commands on two different servers.

Post by Dirk Pattinso » Thu, 29 May 1997 04:00:00



> problem is: I haven't found a way to tell rlogin to issue a command on the
> server just logged onto, and rsh doesn't allow interactive commands, and
> both rsudo and vile are interactive.

Try expect. Expect is an extension to Tcl which allows you automate
arbitrary interactive processes.

You can use a script like this to log onto a remote machine:

spawn /bin/telnet B$host
expect "ogin:"
send "$user\r"
expect "assword:"
send "$passwd\r"
interact

(ie. using expect is consideraby easy).

Dirk.

 
 
 

writing a script that executes commands on two different servers.

Post by Chris Rove » Thu, 29 May 1997 04:00:00



[stuff to automate snipped]

Expect is probably the easiest solution here.

man expect or if its not installed, go hunting for it.

-cdr
--
----------------------------------------------------------------------

http://www.csclub.uwaterloo.ca/u/cdrovers
----------------------Hit any user to continue------------------------

 
 
 

1. Execute script on different server

I am in charge of managing 20 servers on our network, and I need a
better way to run a script on them.  Right now, I have a script that I
copy to each server and a cron job runs them nightly.  I would like to
have a "master script" on a server that would run  a script on each
of the other servers.  I could write this master script if I knew how to
execute a script on another server.

How can I do something like this?
zapper:/usr/local/>  shaggy:/usr/local/testlog.pl

without getting an error like this:
ksh: shaggy:/usr/local/testlog.pl:  not found

I can ssh to shaggy just fine from zapper, but just can't seem to
figure out how to run a script that exists on shaggy from zapper.

Is this possible?

Kurt A. Boyer
MatchLogic, Inc.

2. RPM error

3. Can I execute PHP-script from different server?

4. ISO: SUPPORTED calendar server accessible by Outlook and CDE dtcm

5. Can Linux turn off my computer?

6. Script to detect user that is executing and execute commands accordingly

7. shadow passwd?

8. executing script commands after su command

9. Postgres95 search script: runs from command line but not when executed by server!

10. HELP -- execute some scripts from the command line as a command??????

11. How to execute command from zsh shell in 4 different processes

12. execute script under different user