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 > Operating Systems > HP-UX
.
google unix.com



HP-UX HP-UX (Hewlett Packard UniX) is Hewlett-Packard's proprietary implementation of the Unix operating system, based on System V.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Regarding accessing multiple servers using single public ip address navneet_2009 SuSE 5 07-29-2009 07:30 AM
Putting multiple sed commands on a single line varelg Shell Programming and Scripting 1 07-21-2009 04:02 PM
automatic execution of script after every 10 mins suresh_kb211 Shell Programming and Scripting 1 07-21-2009 09:00 AM
multiple commands execution yschd UNIX for Advanced & Expert Users 1 05-19-2009 11:31 PM
automatic execution of shell script rajamohan Shell Programming and Scripting 1 09-29-2008 06:48 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 5 Days Ago
vickramshetty vickramshetty is offline
Registered User
  
 

Join Date: Nov 2009
Posts: 5
Automatic execution of commands in multiple servers using single script.

Hi,

I've to do a simple job many times whenever it has been asked, just i've to log in to all of fourtien HP servers and i've to execute
ps -fu user > temp
cat temp|sendmail "xyz@z.com"
commands to send the statics of all of 14 servers over the mail to particular user id..

Though logging into each and every server and issuing same command is easy, but its time wasting.

Instead of that i want to create a script and run in single server, so that it can fetch statistics from all servers automatically and sends a single mail.
I've started writing script using SSH command but stuck and couldnt proceed.

please guide me in this regard

Thanks
  #2 (permalink)  
Old 5 Days Ago
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,710
Code:
for node in host1 host2 host3
do
  ssh {$node} 'ps -fu user | sendmail xyz@z.com'
done
start with that - it assumes you have setup ssh keys for each node. And you are not doing this as root.
  #3 (permalink)  
Old 4 Days Ago
vickramshetty vickramshetty is offline
Registered User
  
 

Join Date: Nov 2009
Posts: 5
hi thanks for the reply,

I tested the "for loop" for the two servers, server1 and server2
But its giving the foloowing error
ssh: {server1}: Name or service not known
ssh: {server2}: Name or service not known

Please help in this regard, also i want all the userid and password required for the servers to be hardcoded, ie it shouldnt prompt for password or username

Thanks
  #4 (permalink)  
Old 3 Days Ago
vbe's Avatar
vbe vbe is offline Forum Staff  
Moderator
  
 

Join Date: Sep 2005
Location: Switzerland - GE
Posts: 1,568
No (or not configured...) sendmail on those 2 servers perhaps?
  #5 (permalink)  
Old 3 Days Ago
vickramshetty vickramshetty is offline
Registered User
  
 

Join Date: Nov 2009
Posts: 5
sendmail is working in all of the servers i'm using..
Please check my very first post in this thread. i believe i've explained my problem clearly.

Please help me . i'm still messed in ssh..
Sponsored Links
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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 02:21 AM.


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