Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Search Forums:



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

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 09-08-2010
Registered User
 

Join Date: Jun 2007
Posts: 44
Thanks: 10
Thanked 0 Times in 0 Posts
Script needed...

Hi!

I have a file which has a list of host, I want to ssh to each of the first box for an app and grep through the logs for version of the application and look for a certain string "Connection is open" in the log file. The file I am referring to looks like this -


Code:
prod1-doms-2001.corp.zap.com:App1-America:PROD:8000
prod2-doms-2001.corp.zap.com:App1-Asia:PROD:8020
prod3-doms-2002.corp.zap.com:App1-Europe:PROD:8040
prod1-doms-2001.corp.zap.com:App2-America:PROD:9000
prod2-doms-2001.corp.zap.com:App2-Asia:PROD:9020
prod3-coms-2002.corp.zap.com:App2-Europe:PROD:9040

where columns are separated by colons -

Code:
First column - hostname
Second column - app name 
Third column - env name
Forth column  - port #

I want to ssh to first host of each app then grep for a string called "connection is open" and also parse out (20100613) from a string of line like the following from the log file -

Code:
.... -JbossRootDirectory=/remote/QB/packages/App1-20100712-133944-249b7220ac454586864a7...

Currently I am doing this manually but since there are some 30 hosts, I want to have this executed from a central admin box.

The log file name changes with appname and hostname /port and is of the pattern - /App1-region_prod1-doms-2001.corp_8000

Please share if someone has developed a script which can do this. I want to do this after restart of each app.

Thanks,
Allan

Moderator's Comments:
Use code tags when posting code, data, logs etc., thanks.

Last edited by zaxxon; 09-08-2010 at 03:37 AM..
Sponsored Links
    #2  
Old 09-08-2010
Resident BOFH
 

Join Date: Dec 2007
Posts: 1,100
Thanks: 2
Thanked 76 Times in 74 Posts
Have you tried to write it? Now is a good time to learn so you can be self sufficent in the future. If you write it yourself you will appreciate the time saved later This can be done with a small/simple shell script. Try to write it first. There are many examples to look at.
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Help needed with script. sparcman Shell Programming and Scripting 5 05-14-2010 09:37 AM
help needed for a script!! rahul195 Shell Programming and Scripting 5 10-04-2009 06:15 PM
Script help needed Sagarddd Shell Programming and Scripting 1 11-18-2008 01:02 PM
Script needed vpandey Shell Programming and Scripting 3 03-04-2008 08:45 AM
help needed! my first script fcbarcelona1984 Shell Programming and Scripting 1 11-04-2007 11:32 AM



All times are GMT -4. The time now is 04:12 AM.