The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Microsofts New Approach iBot Cartoons for Geeks 0 08-02-2008 01:40 AM
getopts standard approach - does one exist? dkieran Shell Programming and Scripting 8 05-18-2007 03:19 PM
Performance inquiry...guestimate better approach DreamWarrior High Level Programming 6 01-22-2007 12:57 PM
Scp without writting new2ss Shell Programming and Scripting 7 07-18-2006 05:59 AM
Writting to multiple file jyotipg Shell Programming and Scripting 2 06-25-2004 08:16 AM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 02-03-2009
Bloke Bloke is offline
Registered User
  
 

Join Date: Feb 2009
Posts: 28
Approach to writting a script

Hello all,
I've just joined. I did a google search and your site came up,
I had a look and thought I'd like to become a member.

I'm from Ireland.

I've written a few scripts before, but this new task has me foxed.

I would like to figure out the best approach to achieving the following

A single script that does the following
login to machine a (I typically use putty to do this)
login to machine b (as above)
on machine_a run a command such as "service xxx stop; service xxx start"
on machine_a ps -ef | grep AppName to confirm the app started right
on machine_a run top, and grep for a process by name, and batch the cpu% usage result to a file ( I can do this already)

on machine_b cd to a specific directory
on machine_b run a script that points at machine_a

on machine_b, when the script finishes
machine_a will parse the result file, and confirm the average of the cpu% is less than a threshold

That's pretty much it.
The hard part I suppose would be the single script spawing scripts on two different machines and synchonising them?

Thanks for your help in advance!
Bloke
  #2 (permalink)  
Old 02-03-2009
Radar's Avatar
Radar Radar is offline
Registered User
  
 

Join Date: Dec 2006
Location: Clifton Park, NY
Posts: 86
The easiest approach from a scripting standpoint would be to use ssh to launch commands on the remote system. ssh user@host "command [options]"
  #3 (permalink)  
Old 02-04-2009
Bloke Bloke is offline
Registered User
  
 

Join Date: Feb 2009
Posts: 28
Thanks for reply.

When I tried that
ssh root@XXX.XXX.XXX.XXX "ls -al"

it asked me for a password.

As I would like to automate the process by scripting, without having to type in passwords.

Are there alternative approaches.
  #4 (permalink)  
Old 03-20-2009
Bloke Bloke is offline
Registered User
  
 

Join Date: Feb 2009
Posts: 28
How to clone a 1950 with two 500GB drives in raid

Easy on Windows, but how do I do it on rhel4?
  #5 (permalink)  
Old 03-20-2009
fpmurphy's Avatar
fpmurphy fpmurphy is offline Forum Staff  
Moderator
  
 

Join Date: Dec 2003
Location: Florida
Posts: 1,913
Is this a new question for the group?
  #6 (permalink)  
Old 03-21-2009
Bloke Bloke is offline
Registered User
  
 

Join Date: Feb 2009
Posts: 28
Quote:
Originally Posted by fpmurphy View Post
Is this a new question for the group?
How odd is that! I thought I started a new thread.
I've been posting to the internet for 15 years, never did that before!
  #7 (permalink)  
Old 02-04-2009
pludi's Avatar
pludi pludi is offline Forum Staff  
Moderator
  
 

Join Date: Dec 2008
Location: .at
Posts: 1,839
Set up public key authentication for your account on the server. That should enable password-less login
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 10:08 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0