14 Replies Latest reply on Jan 24, 2018 12:10 PM by Emiliano Cicarelli

    HELP: ERROR: SSH Adapter - Please

    Emiliano Cicarelli

      Hi, I'm Emiliano from Argentina, my English is bad. I hope you can understand, and help me please. I am having problems executing this line from an ssh. And I do not understand why the error. I'm new to BAO - Orchestrator. Sorry..

       

       

      <ssh-command-output>

        <metadata>

        <status>success</status>

        </metadata>

        <targets-output>

        <target-output host="XXX.XXX.XXX.XXX">

        <metadata>

        <os-id>Linux</os-id>

      <os-version>2.6.32-696.18.7.el6.i686</os-version>

        <status>success</status>

        </metadata>

        <commands-output>

        <command-output>

        <metadata>

        <status>error</status>

        <error>Error executing command sudo ssh root@XX.XX.XX.XX /etc/init.d/dif.init restart. Error: Message[summary=Exception occurred in Adapter : SSH Adapter. Error occurred parsing command results. ERROR : Message[summary=Exception occurred in Adapter :adapter terminal. Timeout occurred while connection for getting response data, detail=Exception occurred in Adapter :adapter terminal. Timeout occurred while connection for getting response data], detail=Exception occurred in Adapter : SSH Adapter. Error occurred parsing command results. ERROR : Message[summary=Exception occurred in Adapter :adapter terminal. Timeout occurred while connection for getting response data, detail=Exception occurred in Adapter :adapter terminal. Timeout occurred while connection for getting response data]]</error>

        </metadata>

        <output />

        </command-output>

        </commands-output>

        </target-output>

        </targets-output>

      </ssh-command-output>

       

      Gracias!

        • 1. Re: HELP: ERROR: SSH Adapter - Please
          Ranganath Samudrala

          Please post adapter request XML. It looks like you have not provided correct "prompt".

          • 2. Re: HELP: ERROR: SSH Adapter - Please
            Deepak Bhola

            Increase the command timeout (default is 60 seconds) in SSH process input if command execution take time to complete (provide the value to 300 for testing).

            • 3. Re: HELP: ERROR: SSH Adapter - Please
              Emiliano Cicarelli

              Thank you very much for your answer Ranganath Samudrala, I send you everything I have and how I have it configured plus the full XML.

              The striking thing is that, if I make a stop, it ends OK, if I do Status, OK, but if I do, START or as in this case, RESTART, it ends with that ERROR. Increase the timeout, put sleep within the command, and keep doing the same, I put pause, and the same, I do not know where to point.

               

              ****************

              <prompts>

                <prompt name="input">$</prompt>

              </prompts>

              ****************

              <commands>

                    <command prompt="input" ignore-exit-code="true">sudo ssh root@IPSERVER /etc/init.d/scadifusion.init restart</command>

              </commands>

              ****************

              call ssh adapter

              ****************

              start

               

               

              24 ene 2018 10:47:45,701 [Current Time=Wed Jan 24 10:47:45 ART 2018] [Process Name=:AutoPilot-AD-Utilities:Terminal:SSH] [Root Job Id=09012edd97edbffb:292c4fd0:16128401665:-80001-1516801660732] [Job Id=09012edd97edbffb:292c4fd0:16128401665:-80001-1516801660732/:Sistema_Operativo:ADM_Reiniciar JBOSS-6:start:switch[1]:sequence[2]:switch[1]:sequence[2]:call-process[1]]

              [TEXT=Adapter request]

              [adapter request=

              <request-data>

                <ssh-request>

                <prompts>

                

                <prompt name="input">$</prompt>

                </prompts>

                <targets>

                <target name="">

                <host>172.210.145.184</host>

                <port>22</port>

                <userName>bmcusr</userName>

                <password>

                <EncryptedData xmlns="http://www.w3.org/2001/04/xmlenc#" Type="http://www.w3.org/2001/04/xmlenc#Content">

                <CipherData>

                <CipherValue>fCGT4RYa0S4WO6qL8uKe3A==</CipherValue>

                </CipherData>

                </EncryptedData>

                </password>

                <timeout-secs>30</timeout-secs>

                <use-shell-mode />

                <prompt />

                <establish-connection-timeout-secs>60</establish-connection-timeout-secs>

                </target>

                </targets>

                <commands>

                <command ignore-exit-code="true" prompt="input"><![CDATA[sudo ssh root@172.29.200.26 /etc/init.d/scadifusion.init restart]]></command>

                </commands>

                </ssh-request>

              </request-data>]

               

               

              24 ene 2018 10:48:47,334 [Current Time=Wed Jan 24 10:48:47 ART 2018] [Process Name=:AutoPilot-AD-Utilities:Terminal:SSH] [Root Job Id=09012edd97edbffb:292c4fd0:16128401665:-80001-1516801660732] [Job Id=09012edd97edbffb:292c4fd0:16128401665:-80001-1516801660732/:Sistema_Operativo:ADM_Reiniciar JBOSS-6:start:switch[1]:sequence[2]:switch[1]:sequence[2]:call-process[1]]
              [TEXT=Adapter response]
              [adapter response=
              <ssh-command-output>
                <metadata>
                  <status>success</status>
                </metadata>
                <targets-output>
                  <target-output host="172.210.145.184">
                    <metadata>
                      <os-id>Linux</os-id>
                      <os-version>2.6.32-696.18.7.el6.i686</os-version>
                      <status>success</status>
                    </metadata>
                    <commands-output>
                      <command-output>
                        <metadata>
                          <status>error</status>
                          <error>Error executing command sudo ssh root@172.29.200.26 /etc/init.d/scadifusion.init restart. Error: Message[summary=Exception occurred in Adapter : SSH Adapter. Error occurred parsing command results. ERROR : Message[summary=Exception occurred in Adapter : AMP - Perform Action Executor - 341:ssh:172.210.145.184:StreamReaderWithTimeOut. Message[summary=Exception occurred in adapter : AMP - Perform Action Executor - 341:ssh:172.210.145.184:StreamReaderWithTimeOut. timeout (  60 secs) expired waiting for response with prompt: $. Data read so far:
              Stopping SCA difusion: [  OK  ]

               

              Starting SCA difusion: [  OK  ]

               


              null, detail=Exception occurred in adapter : AMP - Perform Action Executor - 341:ssh:172.210.145.184:StreamReaderWithTimeOut. timeout (  60 secs) expired waiting for response with prompt: $. Data read so far:
              Stopping SCA difusion: [  OK  ]

               

              Starting SCA difusion: [  OK  ]

               


              null], detail=Exception occurred in Adapter : AMP - Perform Action Executor - 341:ssh:172.210.145.184:StreamReaderWithTimeOut. Message[summary=Exception occurred in adapter : AMP - Perform Action Executor - 341:ssh:172.210.145.184:StreamReaderWithTimeOut. timeout (  60 secs) expired waiting for response with prompt: $. Data read so far:
              Stopping SCA difusion: [  OK  ]

               

              Starting SCA difusion: [  OK  ]

               


              null, detail=Exception occurred in adapter : AMP - Perform Action Executor - 341:ssh:172.210.145.184:StreamReaderWithTimeOut. timeout (  60 secs) expired waiting for response with prompt: $. Data read so far:
              Stopping SCA difusion: [  OK  ]

               

              Starting SCA difusion: [  OK  ]

               


              null]], detail=Exception occurred in Adapter : SSH Adapter. Error occurred parsing command results. ERROR : Message[summary=Exception occurred in Adapter : AMP - Perform Action Executor - 341:ssh:172.210.145.184:StreamReaderWithTimeOut. Message[summary=Exception occurred in adapter : AMP - Perform Action Executor - 341:ssh:172.210.145.84:StreamReaderWithTimeOut. timeout (  60 secs) expired waiting for response with prompt: $. Data read so far:
              Stopping SCA difusion: [  OK  ]

               

              Starting SCA difusion: [  OK  ]

               


              null, detail=Exception occurred in adapter : AMP - Perform Action Executor - 341:ssh:172.210.145.184:StreamReaderWithTimeOut. timeout (  60 secs) expired waiting for response with prompt: $. Data read so far:
              Stopping SCA difusion: [  OK  ]

               

              Starting SCA difusion: [  OK  ]

               


              null], detail=Exception occurred in Adapter : AMP - Perform Action Executor - 341:ssh:172.210.145.184:StreamReaderWithTimeOut. Message[summary=Exception occurred in adapter : AMP - Perform Action Executor - 341:ssh:172.210.145.184:StreamReaderWithTimeOut. timeout (  60 secs) expired waiting for response with prompt: $. Data read so far:
              Stopping SCA difusion: [  OK  ]

               

              Starting SCA difusion: [  OK  ]

               


              null, detail=Exception occurred in adapter : AMP - Perform Action Executor - 341:ssh:172.210.145.184:StreamReaderWithTimeOut. timeout (  60 secs) expired waiting for response with prompt: $. Data read so far:
              Stopping SCA difusion: [  OK  ]

               

              Starting SCA difusion: [  OK  ]

               


              null]]]</error>
                        </metadata>
                        <output />
                      </command-output>
                    </commands-output>
                  </target-output>
                </targets-output>
              </ssh-command-output>]

               

               

               

              ******************

               

              to get to need more information, let me know. I await news, Thank you!

              • 4. Re: HELP: ERROR: SSH Adapter - Please
                Emiliano Cicarelli

                Thank you very much for your answer Deepak Bhola, Increase the value of the command timeout to 300, 500, to 259 and remain the same, I put pause, sleep and nothing. Always the same answer.

                 

                <timeout-secs>259</timeout-secs>

                 

                Error executing command sudo ssh root@172.29.200.26 /etc/init.d/scadifusion.init restart. Error: Message[summary=Exception occurred in Adapter : SSH Adapter. Error occurred parsing command results. ERROR : Message[summary=Exception occurred in Adapter : AMP - Perform Action Executor - 344:ssh:172.210.145.184:StreamReaderWithTimeOut. Message[summary=Exception occurred in adapter : AMP - Perform Action Executor - 344:ssh:172.210.145.184:StreamReaderWithTimeOut. timeout ( 60 secs) expired waiting for response with prompt: $. Data read so far:

                 

                to get to need more information, let me know. I await news, Thank you!

                • 5. Re: HELP: ERROR: SSH Adapter - Please
                  Ranganath Samudrala

                  Can you paste screen shots of same command invoked from a terminal window? This will provide us a good way to figure out prompts that need to be used. Is it possible the prompt is a # or a > as opposed to a $ ?

                   

                  If you do not want to know exit code, may be you can try without providing "prompt" or try the request using

                   

                  Try the below request (without prompt)

                  <request-data>

                    <ssh-request>

                      <prompts>

                        <prompt name="input">$</prompt>

                      </prompts>

                      <targets>

                        <target name="">

                  <host>172.210.145.184</host>

                  <port>22</port>

                  <userName>bmcusr</userName>

                  <password>

                    <EncryptedData xmlns="http://www.w3.org/2001/04/xmlenc#" Type="http://www.w3.org/2001/04/xmlenc#Content">

                      <CipherData>

                        <CipherValue>fCGT4RYa0S4WO6qL8uKe3A==</CipherValue>

                      </CipherData>

                    </EncryptedData>

                  </password>

                  <timeout-secs>30</timeout-secs>

                  <use-shell-mode />

                  <prompt></prompt>

                  <establish-connection-timeout-secs>60</establish-connection-timeout-secs>

                        </target>

                      </targets>

                      <commands>

                        <command ignore-exit-code="true"><![CDATA[sudo ssh root@172.29.200.26 /etc/init.d/scadifusion.init restart]]></command>

                      </commands>

                    </ssh-request>

                  </request-data>

                   

                  OR a request with prompt:

                   

                  <request-data>

                    <ssh-request>

                      <prompts>

                        <prompt name="input">$</prompt>

                      </prompts>

                      <targets>

                        <target name="">

                  <host>172.210.145.184</host>

                  <port>22</port>

                  <userName>bmcusr</userName>

                  <password>

                    <EncryptedData xmlns="http://www.w3.org/2001/04/xmlenc#" Type="http://www.w3.org/2001/04/xmlenc#Content">

                      <CipherData>

                        <CipherValue>fCGT4RYa0S4WO6qL8uKe3A==</CipherValue>

                      </CipherData>

                    </EncryptedData>

                  </password>

                  <timeout-secs>30</timeout-secs>

                  <use-shell-mode />

                  <prompt>$</prompt>

                  <establish-connection-timeout-secs>60</establish-connection-timeout-secs>

                        </target>

                      </targets>

                      <commands>

                        <command ignore-exit-code="true" prompt="$"><![CDATA[sudo ssh root@172.29.200.26 /etc/init.d/scadifusion.init restart]]></command>

                      </commands>

                    </ssh-request>

                  </request-data>

                  • 6. Re: HELP: ERROR: SSH Adapter - Please
                    Emiliano Cicarelli

                    the promt is $.

                     


                    What I notice is that to give the result of the last [OK] it takes a longer time than for the first one.

                     

                    thanks!

                    • 7. Re: HELP: ERROR: SSH Adapter - Please
                      Ranganath Samudrala

                      What is the prompt that comes after [ OK ] ?

                      • 8. Re: HELP: ERROR: SSH Adapter - Please
                        Emiliano Cicarelli

                        any. There ends. it would have to end with a "CTRL + C" to return to the promt

                        • 9. Re: HELP: ERROR: SSH Adapter - Please
                          Ranganath Samudrala

                          Are there only 2 [ OK ] ?

                          • 11. Re: HELP: ERROR: SSH Adapter - Please
                            Ranganath Samudrala

                            Then, your prompt should be something like:

                             

                            <command ignore-exit-code="true" prompt="Starting SCA difusion: [  OK  ]"><![CDATA[sudo ssh root@172.29.200.26 /etc/init.d/scadifusion.init restart]]></command>

                             

                             

                            OR

                             

                            <command ignore-exit-code="true" prompt="[  OK  ]" num-prompt-occurrences="2" terminate-on-exit="true"><![CDATA[sudo ssh root@172.29.200.26 /etc/init.d/scadifusion.init restart]]></command>

                            • 12. Re: HELP: ERROR: SSH Adapter - Please
                              Emiliano Cicarelli

                              Excellent Ranganath Samudrala. Now the workflow, is as I wanted. =)

                               

                              <output>

                                <line index="1">Stopping SCA difusion: [ OK ] </line>

                                <line index="2">Starting SCA difusion: [ OK ] </line>

                              </output>

                               

                              Query: Why this error and what have we modified?

                              Really thank you very much ...

                              • 13. Re: HELP: ERROR: SSH Adapter - Please
                                Ranganath Samudrala

                                The adapter is looking for a string/character (prompt) that it uses to stop reading from the command output. In your case, the command  never terminates unless you issue a CTRL-C and nobody is issuing it. So, it is looking for default prompt $, which is never seen. It waits for a default time of 60 seconds before it terminates and returns with an error.

                                If we, specify a prompt like [ OK ] then, it will return after the first occurrence of [ OK ]  with a response:

                                <output>

                                  <line index="1">Stopping SCA difusion: [ OK ] </line>

                                </output>

                                 

                                You either specify a prompt like "Starting SCA difusion: [ OK ]" or specify the prompt to be [ OK ] and also say that it occurs 2 times so that both lines are returned in your output.

                                1 of 1 people found this helpful
                                • 14. Re: HELP: ERROR: SSH Adapter - Please
                                  Emiliano Cicarelli

                                  Oh perfect! Thank you very much for the information, it will be very useful for future cases. Thank you very much friend ...