remote execution


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting remote execution
# 1  
Old 04-09-2004
remote execution

Hi everybody,
sorry if the question will be too trivial for some of you, but I'm not a unix shell programmer expert.
I need to write a script that allows me to rlogin to another machine, check the load (cpu and mem usage) of the new machine, start a process (that will run in the background) and logout.
If I try:

rlogin new-machine
cd path/
...

after the rlogin, it will execute the 'cd' command locally instead of remotely. How can I make the script to execute the commands after the rlogin remotely?
How can I check the machine load?

Please let me know if my approach is completely wrong.

Many thanks in advance,
Carmelo
# 2  
Old 04-09-2004
rsh or remsh may work better for you. Check out the man pages. From your description, a cron job may even work for you. The cron job would check the load and start the process.

I don't know which specific load information you are looking for but uname -a or sar may give you what you want.
# 3  
Old 04-10-2004
You can use uptime to find out system load. Also if you want to determine the load based on the current CPU usage you may try

sar -u 1 1|/usr/xpg4/bin/grep -E ':'|grep -v usr|awk '{print $2+$3}'

Thus will print the sum of user and kernel % CPU usage
# 4  
Old 04-10-2004
Hi,
thanks for your reply. I've used the 'rsh' command without problem. Regarding the 'sar' command, I don't have it. I had a look on the web and after I found it, I couldn't complete the installation because it complained about root permissions which I don't have. Is there any other way to install it? Or is it possible to use something else? What about uptime? I don't understand the values of load average in terms of what they are expressed. I just need the percentage of CPU usage, which it doesn't seem to give.

Thanks,
Carmelo
# 5  
Old 04-10-2004
Sorry I forgot to say, if can be useful, that I'm using a Linux box with red-hat 7.3.

Thanks
Carmelo
# 6  
Old 04-10-2004
Try man uptime
the system load averages for the past 1, 5, and 15 minutes.

Also you can get the %CPu usage using top, iostat and ps also.

Last edited by sssow; 04-10-2004 at 03:47 PM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Pause processes in remote host and resume execution in another remote host

Hi, Given addresses of 2 remote machines, using a shell script is it possible to get the state of running processes in "src" stop all the processes in "src" exit out of "src" ssh into "dest" resume the state of executing processes captured in step 1 in "dest" Assumption: "src" is... (3 Replies)
Discussion started by: Saeya Darsan
3 Replies

2. Shell Programming and Scripting

output from remote server during execution of a script

How to see the output from remote server during execution of a script ? I am executing a script (ls) from machine 1 but the o/p should be displayed in machine 2. Can I achieve this ? Example:- Machine 1:- # ls Machine 2:- (console) file1 file2 file 3 dir1 dir2 (0 Replies)
Discussion started by: frintocf
0 Replies

3. Programming

Perl script remote execution as another user

Hi gurus, I have a requirement where I need to remotely run a perl script as another user. Running the script locally as the required user is fine, however I need to su with the script due to filesystem permission issues. I do not want to update permissions on the remote server due to security... (5 Replies)
Discussion started by: melias
5 Replies

4. Cybersecurity

Log remote execution over SSH

If a user execute commands remotely over ssh : $ ssh USERNAME@SERVER COMMANDSHow the SERVER administrator can log those COMMANDS executed in a "not a tty" session ? I searched for my question and get the following suggestions:Anybody give help how to do this ? what the content of "/bin/bash "... (1 Reply)
Discussion started by: new0h
1 Replies

5. Red Hat

Remote execution of QTP from LInux

Hi, We have maven build setup on linux machine and QTP on windows machine. Now, we want to launch QTP from the maven build process which would execute a series of test scripts and return the outcome to the maven process. Based on the result, the maven would have to pass or fail. I tried... (0 Replies)
Discussion started by: Jeevaraj2
0 Replies

6. UNIX for Dummies Questions & Answers

Remote file execution

Hello, I'm new to scripting so, sorry if this is a dumb question. What's the best way to execute a .sh file remotely? I want to log into server "b" from server "a" & run a script. "./scriptname.sh". At this point, all I'm looking to do is a simple ls -la > output.txt within the script to capture... (3 Replies)
Discussion started by: crunch10c
3 Replies

7. Shell Programming and Scripting

help with remote execution of a script

does anyone know how can i execute a script which i locally run as " . /etc/local/host/src.srvr -D ." need to execute above command in rexec command. if i put the command as it is it does not run. Sorry but i am naive in scripting. Thanks rexec sgplqim -l vau -n ' ' (0 Replies)
Discussion started by: NK4U
0 Replies

8. Shell Programming and Scripting

remote execution of find -exec

Hi folks I am working on a script which lists files of a specific pattern on a remote m/c and tar&zip them to another remote m/c via a centralized server. M/C details: remote1 - OSF1 vayu V5.1 2650 alpha remote2 - cygwin based windows server central - SunOS phys-chenab 5.8... (2 Replies)
Discussion started by: royalbull
2 Replies

9. Shell Programming and Scripting

Remote command execution

We have multiple Unix servers and a particular command can only be executed in one of the box from a specific path. I have password-less ssh set up for all the boxes. I am unsure the command to use to execute that particular command from any other box. To be specific say program named _my_exe_ can... (4 Replies)
Discussion started by: uunniixx
4 Replies

10. AIX

remote execution

good morning I would like copy and execute a shell script on a remote server telnet is not autorize, so i use ssh: scp to copy and ssh to execute But with the scp, the permissions are not saved and the file 's permission on the remote server is r--r--r-- , so i can't execute it Can you help... (2 Replies)
Discussion started by: pascalbout
2 Replies
Login or Register to Ask a Question