using shell script connect another machines run the script result shown in web page

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gupta24
    New Member
    • May 2008
    • 11

    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
  • gpraghuram
    Recognized Expert Top Contributor
    • Mar 2007
    • 1275

    #2
    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

    Comment

    • gupta24
      New Member
      • May 2008
      • 11

      #3
      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

      Comment

      • docdiesel
        Recognized Expert Contributor
        • Aug 2007
        • 297

        #4
        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

        Code:
        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

        Comment

        • gupta24
          New Member
          • May 2008
          • 11

          #5
          Thanks very much

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



          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

          Code:
          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

          Comment

          • gupta24
            New Member
            • May 2008
            • 11

            #6
            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


            Originally posted by gupta24
            Thanks very much

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

            Comment

            • docdiesel
              Recognized Expert Contributor
              • Aug 2007
              • 297

              #7
              Hi,

              try the following:

              Code:
              echo "test" | ssh [I]youruser@rmtsystem[/I] "cat >/tmp/test.txt"
              and replace youruser@rmtsys tem 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

              Comment

              • gupta24
                New Member
                • May 2008
                • 11

                #8
                sorry not working

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


                Originally posted by docdiesel
                Hi,

                try the following:

                Code:
                echo "test" | ssh [I]youruser@rmtsystem[/I] "cat >/tmp/test.txt"
                and replace youruser@rmtsys tem 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

                Comment

                • docdiesel
                  Recognized Expert Contributor
                  • Aug 2007
                  • 297

                  #9
                  Hi,

                  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

                  Comment

                  Working...