Help | Site Map
Connecting Tech Pros Worldwide
Reply
 
LinkBack Thread Tools
  #1  
Old May 22nd, 2008, 04:08 PM
Newbie
 
Join Date: May 2008
Posts: 11
Default using shell script connect another machines run the script result shown in web page

i am in critical position please help
we have machines a,b,c,d
in each machine application servers are running
but each machine have 40 application server are running
result of 40 application servers are running or not shown in the web page.


but i am in z machine
when run the script (http://172.30.98.91:/cgi/health.ksh) in web page
Result will show in the web page .

Resultant in web page


Server a machine b machine c machine d machine
--------------------------------------------------------------------------------------------
trowe running running running running
republic running not running running running
universal not running
. ,
.
. ,
.
.
acs running running running running


it very help full greate becaues i am trouble .please help
Reply
  #2  
Old May 23rd, 2008, 02:19 AM
gpraghuram's Avatar
Expert
 
Join Date: Mar 2007
Location: Chennai
Age: 29
Posts: 1,159
Default

If u want to connect to another box and run a script then u should use rsh for this.

Provide more details so that people here can help u.

Raghu
Reply
  #3  
Old May 24th, 2008, 03:58 PM
Newbie
 
Join Date: May 2008
Posts: 11
Default

we have 4 different machines (unix)
in each machines haveing 40 servers running
and we write the shell script like go to the 4 machines run the script and result will get in to another machine( servers running or not)

Please help i am in critical position
Reply
  #4  
Old May 25th, 2008, 10:58 PM
docdiesel's Avatar
Moderator
 
Join Date: Aug 2007
Location: Munich
Posts: 284
Default

Hi,

if I understand your needs right, you want to have one script which
  1. is maintained on machine z
  2. is sent to system a,b,c,d
  3. is remotely executed there while
  4. you need the output on machine z.

Try something like

Expand|Select|Wrap|Line Numbers
  1. cat check.sh | ssh checkusr@${rmtsys} >${rmtsys}.out 2>${rmtsys}.err
where rmtsys is a variable containing the remote systems name (you could try to use a for() loop). The output of the script is stored in the .out and .err files. If setup right by exchanging keys, the ssh enters [a,b,c,d] without prompting for a password.

Regards,

Bernd
Reply
  #5  
Old May 28th, 2008, 12:42 PM
Newbie
 
Join Date: May 2008
Posts: 11
Default

Thanks very much

once check the below code and update it will work or not



Quote:
Originally Posted by docdiesel
Hi,

if I understand your needs right, you want to have one script which
  1. is maintained on machine z
  2. is sent to system a,b,c,d
  3. is remotely executed there while
  4. you need the output on machine z.

Try something like

Expand|Select|Wrap|Line Numbers
  1. cat check.sh | ssh checkusr@${rmtsys} >${rmtsys}.out 2>${rmtsys}.err
where rmtsys is a variable containing the remote systems name (you could try to use a for() loop). The output of the script is stored in the .out and .err files. If setup right by exchanging keys, the ssh enters [a,b,c,d] without prompting for a password.

Regards,

Bernd
Reply
  #6  
Old May 28th, 2008, 01:44 PM
Newbie
 
Join Date: May 2008
Posts: 11
Default

i try below code , is not working (it will going another machine but not running in that machine and out put also not comeing in that machine)

please help help ......................

Regards,
gutpa


Quote:
Originally Posted by gupta24
Thanks very much

once check the below code and update it will work or not
Reply
  #7  
Old May 29th, 2008, 03:18 PM
docdiesel's Avatar
Moderator
 
Join Date: Aug 2007
Location: Munich
Posts: 284
Default

Hi,

try the following:

Expand|Select|Wrap|Line Numbers
  1. echo "test" | ssh youruser@rmtsystem "cat >/tmp/test.txt"
and replace youruser@rmtsystem with appropriate username and servername. This line should ask for youruser's password and afterwards a file /tmp/test.txt on rmtsystem should contain the text "test". Does this work at your site?

Regards,

Bernd
Reply
  #8  
Old June 3rd, 2008, 06:57 AM
Newbie
 
Join Date: May 2008
Posts: 11
Default

sorry not working

still in critical please help....................


Quote:
Originally Posted by docdiesel
Hi,

try the following:

Expand|Select|Wrap|Line Numbers
  1. echo "test" | ssh youruser@rmtsystem "cat >/tmp/test.txt"
and replace youruser@rmtsystem with appropriate username and servername. This line should ask for youruser's password and afterwards a file /tmp/test.txt on rmtsystem should contain the text "test". Does this work at your site?

Regards,

Bernd
Reply
  #9  
Old June 6th, 2008, 02:14 PM
docdiesel's Avatar
Moderator
 
Join Date: Aug 2007
Location: Munich
Posts: 284
Default

Hi,

Quote:
Originally Posted by gupta24
sorry not working
is a very detailed answer. What error message did the command display, if any? Btw., are you sure there's ssh software installed on clients and servers?

To enable anybody to help you any further you've got to give more information, especially about your environment (operating system(s), shell(s) used, ...).

Regards,

Bernd
Reply
Reply

Bookmarks

Thread Tools

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

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles