1 2 Previous Next 23 Replies Latest reply on Aug 30, 2011 12:53 PM by Ranganath Samudrala

    How to Use Orchestrator (AO) to execute commands on networking devices (e.g. Cisco)

      Share This:

      Hi All,

       

      Is it possble to use the SSH adapter in AO to log into a networking device like a router, firewall, etc., execute commands and then get the output? I have used the SSH adapter for Linux but have not been successful with using it for Cisco devices. Has anyone done this?

       

      Thanks,

      Asha

        • 1. How to Use Orchestrator (AO) to execute commands on networking devices (e.g. Cisco)
          Ranganath Samudrala

          It is possible and people have used both SSH and Telnet adapters in this regard. It will help if you enable debug logging on adapters and post the error you are seeing.

          • 2. How to Use Orchestrator (AO) to execute commands on networking devices (e.g. Cisco)

            This is what I get below for output... I am trying to do a simple "show vlan" command on a Cisco firewall and get the output. It says that there is an error parsing the command results. I don't know what I am doing wrong.

             

            DEBUG - Started all local peers.

            DEBUG - ---------------------------------------------------

            DEBUG - --   About to Start WorkFlow Testing

            DEBUG - ---------------------------------------------------

            DEBUG -                Process Details:

            DEBUG -                  Grid Name: GRID1

            DEBUG -                  Module Name: Sandbox01

            DEBUG -                  Process ID: :Sandbox01:sshfw

            DEBUG - Launch Requested

            INFO - [Current Time=Mon Aug 29 10:33:22 EDT 2011] [Process Name=:Sandbox01:sshfw] [Root Job Id=0aeca1b2167bddd2:464e84c1:13215f0af68:-80001-1314628402806] [Job Id=0aeca1b2167bddd2:464e84c1:13215f0af68:-80001-1314628402806]

            The process started. It is triggered by the scheduler.

            DEBUG - [Current Time=Mon Aug 29 10:33:22 EDT 2011] [Process Name=:AutoPilot-AD-Utilities:Terminal:SSH] [Root Job Id=0aeca1b2167bddd2:464e84c1:13215f0af68:-80001-1314628402806] [Job Id=0aeca1b2167bddd2:464e84c1:13215f0af68:-80001-1314628402806/:Sandbox01:sshfw:start:call-process[1]]

            password is::

            [output=<![CDATA[]]>]

            DEBUG - [Current Time=Mon Aug 29 10:33:22 EDT 2011] [Process Name=:AutoPilot-AD-Utilities:Terminal:SSH] [Root Job Id=0aeca1b2167bddd2:464e84c1:13215f0af68:-80001-1314628402806] [Job Id=0aeca1b2167bddd2:464e84c1:13215f0af68:-80001-1314628402806/:Sandbox01:sshfw:start:call-process[1]]

            Adapter request

            [adapter request=

            <request-data>

              <ssh-request>

                <prompts>

                  <prompt name="first">LAB-FWSM-SUW/LAB-FW01-PRI-SUW></prompt>

                  <prompt name="second">Password:</prompt>

                  <prompt name="third">LAB-FWSM-SUW/LAB-FW01-PRI-SUW#</prompt>

                </prompts>

                <commands>

                  <command><![CDATA[enable]]></command>

                  <command prompt="second"><![CDATA[abc123]]></command>

                  <command prompt="third"><![CDATA[show vlan]]></command>

                </commands>

              </ssh-request>

            </request-data>]

            DEBUG - [Current Time=Mon Aug 29 10:34:28 EDT 2011] [Process Name=:AutoPilot-AD-Utilities:Terminal:SSH] [Root Job Id=0aeca1b2167bddd2:464e84c1:13215f0af68:-80001-1314628402806] [Job Id=0aeca1b2167bddd2:464e84c1:13215f0af68:-80001-1314628402806/:Sandbox01:sshfw:start:call-process[1]]

            Adapter response

            [adapter response=

            <ssh-command-output>

              <metadata>

                <status>success</status>

              </metadata>

              <targets-output>

                <target-output host="10.222.22.22">

                  <metadata>

                    <status>success</status>

                  </metadata>

                  <commands-output>

                    <command-output>

                      <metadata>

                        <status>error</status>

                       <error>Error executing command enable. Error: Message[summary=Exception occured in Adapter : SSHadapterOSCFW. Error occured parsing command results. ERROR : , detail=Exception occured in Adapter : SSHadapterOSCFW. Error occured parsing command results. ERROR : ]</error>

                      </metadata>

                      <output />

                    </command-output>

                  </commands-output>

                </target-output>

              </targets-output>

            </ssh-command-output>]

            INFO - [Current Time=Mon Aug 29 10:34:28 EDT 2011] [Process Name=:Sandbox01:sshfw] [Root Job Id=0aeca1b2167bddd2:464e84c1:13215f0af68:-80001-1314628402806] [Job Id=0aeca1b2167bddd2:464e84c1:13215f0af68:-80001-1314628402806]

            The process terminated in the completed state.

            • 3. How to Use Orchestrator (AO) to execute commands on networking devices (e.g. Cisco)
              Ranganath Samudrala

              Can you attach grid.log from the peer where you have the adapter enabled (AO_HOME/tomcat/logs folder)?

              • 4. Re: How to Use Orchestrator (AO) to execute commands on networking devices (e.g. Cisco)

                I keep getting an error when I try to attach a file. Please see below grid log.

                 

                29 Aug 2011 07:28:18,151 ERROR AbstractCommandLineActorAdapter : [Thread=AMP - Perform Action Executor - 29][Adapter=SSHadapterOSCFW]

                 

                 

                [Adapter=SSHadapterOSCFW : Error closing invalid terminal connection. ERROR: Message[summary=Exception occured in Adapter :

                 

                 

                SSHadapterOSCFW. Error occured parsing command results. ERROR : , detail=Exception occured in Adapter : SSHadapterOSCFW. Error occured

                 

                 

                parsing command results. ERROR : ]]

                com.realops.adapter.terminal.connection.ConnectionException: Message[summary=Exception occured in Adapter : SSHadapterOSCFW. Error

                 

                 

                occured parsing command results. ERROR : , detail=Exception occured in Adapter : SSHadapterOSCFW. Error occured parsing command

                 

                 

                results. ERROR : ]

                          at com.realops.adapter.terminal.connection.MaverickSSHConnection.performCommand(MaverickSSHConnection.java:993)

                          at com.realops.adapter.terminal.AbstractCommandLineActorAdapter.executeCommand(AbstractCommandLineActorAdapter.java:475)

                          at com.realops.adapter.terminal.AbstractCommandLineActorAdapter.executeCommandItem(AbstractCommandLineActorAdapter.java:362)

                          at com.realops.adapter.terminal.AbstractCommandLineActorAdapter.performAction(AbstractCommandLineActorAdapter.java:947)

                          at sun.reflect.GeneratedMethodAccessor1120.invoke(Unknown Source)

                          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

                          at java.lang.reflect.Method.invoke(Method.java:597)

                          at com.realops.common.util.proxy.ContextClassLoaderDecoratorFactory$IsolatedInvocationHandler.doInvoke

                 

                 

                (ContextClassLoaderDecoratorFactory.java:79)

                          at com.realops.common.util.proxy.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:89)

                          at $Proxy179.performAction(Unknown Source)

                          at com.realops.foundation.adapterframework.AdapterManager.performAction(AdapterManager.java:2474)

                          at com.realops.foundation.adapterframework.DefaultAdapterProxy.performActionImpl(DefaultAdapterProxy.java:408)

                          at com.realops.foundation.adapterframework.DefaultAdapterProxy.access$000(DefaultAdapterProxy.java:69)

                          at com.realops.foundation.adapterframework.DefaultAdapterProxy$1.run(DefaultAdapterProxy.java:432)

                          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

                          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

                          at java.lang.Thread.run(Thread.java:662)

                Caused by: com.maverick.ssh.ChannelOpenException:

                          at com.maverick.ssh2.b.b(Unknown Source)

                          at com.maverick.ssh2.Ssh2Client.openSessionChannel(Unknown Source)

                          at com.maverick.ssh2.Ssh2Client.openSessionChannel(Unknown Source)

                          at com.realops.adapter.terminal.connection.MaverickSSHConnection.openSessionWithListener(MaverickSSHConnection.java:707)

                          at com.realops.adapter.terminal.connection.MaverickSSHConnection.openSession(MaverickSSHConnection.java:608)

                          at com.realops.adapter.terminal.connection.MaverickSSHConnection.sendCommand(MaverickSSHConnection.java:1056)

                          at com.realops.adapter.terminal.connection.MaverickSSHConnection.sendCommand(MaverickSSHConnection.java:1020)

                          at com.realops.adapter.terminal.connection.MaverickSSHConnection.performCommand(MaverickSSHConnection.java:915)

                          ... 16 more

                29 Aug 2011 07:30:07,354 ERROR MaverickSSHConnection : Exception :

                com.maverick.ssh.ChannelOpenException:

                          at com.maverick.ssh2.b.b(Unknown Source)

                          at com.maverick.ssh2.Ssh2Client.openSessionChannel(Unknown Source)

                          at com.maverick.ssh2.Ssh2Client.openSessionChannel(Unknown Source)

                          at com.realops.adapter.terminal.connection.MaverickSSHConnection.openSessionWithListener(MaverickSSHConnection.java:707)

                          at com.realops.adapter.terminal.connection.MaverickSSHConnection.openSession(MaverickSSHConnection.java:608)

                          at com.realops.adapter.terminal.connection.MaverickSSHConnection.sendCommand(MaverickSSHConnection.java:1056)

                          at com.realops.adapter.terminal.connection.MaverickSSHConnection.sendCommand(MaverickSSHConnection.java:1020)

                          at com.realops.adapter.terminal.connection.MaverickSSHConnection.performCommand(MaverickSSHConnection.java:915)

                          at com.realops.adapter.terminal.AbstractCommandLineActorAdapter.executeCommand(AbstractCommandLineActorAdapter.java:475)

                          at com.realops.adapter.terminal.AbstractCommandLineActorAdapter.executeCommandItem(AbstractCommandLineActorAdapter.java:362)

                          at com.realops.adapter.terminal.AbstractCommandLineActorAdapter.performAction(AbstractCommandLineActorAdapter.java:947)

                          at sun.reflect.GeneratedMethodAccessor1120.invoke(Unknown Source)

                          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

                          at java.lang.reflect.Method.invoke(Method.java:597)

                          at com.realops.common.util.proxy.ContextClassLoaderDecoratorFactory$IsolatedInvocationHandler.doInvoke

                 

                 

                (ContextClassLoaderDecoratorFactory.java:79)

                          at com.realops.common.util.proxy.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:89)

                          at $Proxy179.performAction(Unknown Source)

                          at com.realops.foundation.adapterframework.AdapterManager.performAction(AdapterManager.java:2474)

                          at com.realops.foundation.adapterframework.DefaultAdapterProxy.performActionImpl(DefaultAdapterProxy.java:408)

                          at com.realops.foundation.adapterframework.DefaultAdapterProxy.access$000(DefaultAdapterProxy.java:69)

                          at com.realops.foundation.adapterframework.DefaultAdapterProxy$1.run(DefaultAdapterProxy.java:432)

                          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

                          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

                          at java.lang.Thread.run(Thread.java:662)

                29 Aug 2011 07:30:07,354 ERROR AbstractCommandLineActorAdapter : [Thread=AMP - Perform Action Executor - 30][Adapter=SSHadapterOSCFW]

                 

                 

                [Adapter=SSHadapterOSCFW : Error closing invalid terminal connection. ERROR: Message[summary=Exception occured in Adapter :

                 

                 

                SSHadapterOSCFW. Error occured parsing command results. ERROR : , detail=Exception occured in Adapter : SSHadapterOSCFW. Error occured

                 

                 

                parsing command results. ERROR : ]]

                com.realops.adapter.terminal.connection.ConnectionException: Message[summary=Exception occured in Adapter : SSHadapterOSCFW. Error

                 

                 

                occured parsing command results. ERROR : , detail=Exception occured in Adapter : SSHadapterOSCFW. Error occured parsing command

                 

                 

                results. ERROR : ]

                          at com.realops.adapter.terminal.connection.MaverickSSHConnection.performCommand(MaverickSSHConnection.java:993)

                          at com.realops.adapter.terminal.AbstractCommandLineActorAdapter.executeCommand(AbstractCommandLineActorAdapter.java:475)

                          at com.realops.adapter.terminal.AbstractCommandLineActorAdapter.executeCommandItem(AbstractCommandLineActorAdapter.java:362)

                          at com.realops.adapter.terminal.AbstractCommandLineActorAdapter.performAction(AbstractCommandLineActorAdapter.java:947)

                          at sun.reflect.GeneratedMethodAccessor1120.invoke(Unknown Source)

                          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

                          at java.lang.reflect.Method.invoke(Method.java:597)

                          at com.realops.common.util.proxy.ContextClassLoaderDecoratorFactory$IsolatedInvocationHandler.doInvoke

                 

                 

                (ContextClassLoaderDecoratorFactory.java:79)

                          at com.realops.common.util.proxy.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:89)

                          at $Proxy179.performAction(Unknown Source)

                          at com.realops.foundation.adapterframework.AdapterManager.performAction(AdapterManager.java:2474)

                          at com.realops.foundation.adapterframework.DefaultAdapterProxy.performActionImpl(DefaultAdapterProxy.java:408)

                          at com.realops.foundation.adapterframework.DefaultAdapterProxy.access$000(DefaultAdapterProxy.java:69)

                          at com.realops.foundation.adapterframework.DefaultAdapterProxy$1.run(DefaultAdapterProxy.java:432)

                          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

                          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

                          at java.lang.Thread.run(Thread.java:662)

                Caused by: com.maverick.ssh.ChannelOpenException:

                          at com.maverick.ssh2.b.b(Unknown Source)

                          at com.maverick.ssh2.Ssh2Client.openSessionChannel(Unknown Source)

                          at com.maverick.ssh2.Ssh2Client.openSessionChannel(Unknown Source)

                          at com.realops.adapter.terminal.connection.MaverickSSHConnection.openSessionWithListener(MaverickSSHConnection.java:707)

                          at com.realops.adapter.terminal.connection.MaverickSSHConnection.openSession(MaverickSSHConnection.java:608)

                          at com.realops.adapter.terminal.connection.MaverickSSHConnection.sendCommand(MaverickSSHConnection.java:1056)

                          at com.realops.adapter.terminal.connection.MaverickSSHConnection.sendCommand(MaverickSSHConnection.java:1020)

                          at com.realops.adapter.terminal.connection.MaverickSSHConnection.performCommand(MaverickSSHConnection.java:915)

                          ... 16 more

                29 Aug 2011 07:30:36,135 ERROR MaverickSSHConnection : Exception :

                com.maverick.ssh.ChannelOpenException:

                          at com.maverick.ssh2.b.b(Unknown Source)

                          at com.maverick.ssh2.Ssh2Client.openSessionChannel(Unknown Source)

                          at com.maverick.ssh2.Ssh2Client.openSessionChannel(Unknown Source)

                          at com.realops.adapter.terminal.connection.MaverickSSHConnection.openSessionWithListener(MaverickSSHConnection.java:707)

                          at com.realops.adapter.terminal.connection.MaverickSSHConnection.openSession(MaverickSSHConnection.java:608)

                          at com.realops.adapter.terminal.connection.MaverickSSHConnection.sendCommand(MaverickSSHConnection.java:1056)

                          at com.realops.adapter.terminal.connection.MaverickSSHConnection.sendCommand(MaverickSSHConnection.java:1020)

                          at com.realops.adapter.terminal.connection.MaverickSSHConnection.performCommand(MaverickSSHConnection.java:915)

                          at com.realops.adapter.terminal.AbstractCommandLineActorAdapter.executeCommand(AbstractCommandLineActorAdapter.java:475)

                          at com.realops.adapter.terminal.AbstractCommandLineActorAdapter.executeCommandItem(AbstractCommandLineActorAdapter.java:362)

                          at com.realops.adapter.terminal.AbstractCommandLineActorAdapter.performAction(AbstractCommandLineActorAdapter.java:947)

                          at sun.reflect.GeneratedMethodAccessor1120.invoke(Unknown Source)

                          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

                          at java.lang.reflect.Method.invoke(Method.java:597)

                          at com.realops.common.util.proxy.ContextClassLoaderDecoratorFactory$IsolatedInvocationHandler.doInvoke

                 

                 

                (ContextClassLoaderDecoratorFactory.java:79)

                          at com.realops.common.util.proxy.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:89)

                          at $Proxy179.performAction(Unknown Source)

                          at com.realops.foundation.adapterframework.AdapterManager.performAction(AdapterManager.java:2474)

                          at com.realops.foundation.adapterframework.DefaultAdapterProxy.performActionImpl(DefaultAdapterProxy.java:408)

                          at com.realops.foundation.adapterframework.DefaultAdapterProxy.access$000(DefaultAdapterProxy.java:69)

                          at com.realops.foundation.adapterframework.DefaultAdapterProxy$1.run(DefaultAdapterProxy.java:432)

                          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

                          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

                          at java.lang.Thread.run(Thread.java:662)

                29 Aug 2011 07:30:36,135 ERROR AbstractCommandLineActorAdapter : [Thread=AMP - Perform Action Executor - 31][Adapter=SSHadapterOSCFW]

                 

                 

                [Adapter=SSHadapterOSCFW : Error closing invalid terminal connection. ERROR: Message[summary=Exception occured in Adapter :

                 

                 

                SSHadapterOSCFW. Error occured parsing command results. ERROR : , detail=Exception occured in Adapter : SSHadapterOSCFW. Error occured

                 

                 

                parsing command results. ERROR : ]]

                com.realops.adapter.terminal.connection.ConnectionException: Message[summary=Exception occured in Adapter : SSHadapterOSCFW. Error

                 

                 

                occured parsing command results. ERROR : , detail=Exception occured in Adapter : SSHadapterOSCFW. Error occured parsing command

                 

                 

                results. ERROR : ]

                          at com.realops.adapter.terminal.connection.MaverickSSHConnection.performCommand(MaverickSSHConnection.java:993)

                          at com.realops.adapter.terminal.AbstractCommandLineActorAdapter.executeCommand(AbstractCommandLineActorAdapter.java:475)

                          at com.realops.adapter.terminal.AbstractCommandLineActorAdapter.executeCommandItem(AbstractCommandLineActorAdapter.java:362)

                          at com.realops.adapter.terminal.AbstractCommandLineActorAdapter.performAction(AbstractCommandLineActorAdapter.java:947)

                          at sun.reflect.GeneratedMethodAccessor1120.invoke(Unknown Source)

                          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

                          at java.lang.reflect.Method.invoke(Method.java:597)

                          at com.realops.common.util.proxy.ContextClassLoaderDecoratorFactory$IsolatedInvocationHandler.doInvoke

                 

                 

                (ContextClassLoaderDecoratorFactory.java:79)

                          at com.realops.common.util.proxy.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:89)

                          at $Proxy179.performAction(Unknown Source)

                          at com.realops.foundation.adapterframework.AdapterManager.performAction(AdapterManager.java:2474)

                          at com.realops.foundation.adapterframework.DefaultAdapterProxy.performActionImpl(DefaultAdapterProxy.java:408)

                          at com.realops.foundation.adapterframework.DefaultAdapterProxy.access$000(DefaultAdapterProxy.java:69)

                          at com.realops.foundation.adapterframework.DefaultAdapterProxy$1.run(DefaultAdapterProxy.java:432)

                          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

                          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

                          at java.lang.Thread.run(Thread.java:662)

                Caused by: com.maverick.ssh.ChannelOpenException:

                          at com.maverick.ssh2.b.b(Unknown Source)

                          at com.maverick.ssh2.Ssh2Client.openSessionChannel(Unknown Source)

                          at com.maverick.ssh2.Ssh2Client.openSessionChannel(Unknown Source)

                          at com.realops.adapter.terminal.connection.MaverickSSHConnection.openSessionWithListener(MaverickSSHConnection.java:707)

                          at com.realops.adapter.terminal.connection.MaverickSSHConnection.openSession(MaverickSSHConnection.java:608)

                          at com.realops.adapter.terminal.connection.MaverickSSHConnection.sendCommand(MaverickSSHConnection.java:1056)

                          at com.realops.adapter.terminal.connection.MaverickSSHConnection.sendCommand(MaverickSSHConnection.java:1020)

                          at com.realops.adapter.terminal.connection.MaverickSSHConnection.performCommand(MaverickSSHConnection.java:915)

                          ... 16 more

                29 Aug 2011 07:33:32,791 ERROR MaverickSSHConnection : Exception :

                com.maverick.ssh.ChannelOpenException:

                          at com.maverick.ssh2.b.b(Unknown Source)

                          at com.maverick.ssh2.Ssh2Client.openSessionChannel(Unknown Source)

                          at com.maverick.ssh2.Ssh2Client.openSessionChannel(Unknown Source)

                          at com.realops.adapter.terminal.connection.MaverickSSHConnection.openSessionWithListener(MaverickSSHConnection.java:707)

                          at com.realops.adapter.terminal.connection.MaverickSSHConnection.openSession(MaverickSSHConnection.java:608)

                          at com.realops.adapter.terminal.connection.MaverickSSHConnection.sendCommand(MaverickSSHConnection.java:1056)

                          at com.realops.adapter.terminal.connection.MaverickSSHConnection.sendCommand(MaverickSSHConnection.java:1020)

                          at com.realops.adapter.terminal.connection.MaverickSSHConnection.performCommand(MaverickSSHConnection.java:915)

                          at com.realops.adapter.terminal.AbstractCommandLineActorAdapter.executeCommand(AbstractCommandLineActorAdapter.java:475)

                          at com.realops.adapter.terminal.AbstractCommandLineActorAdapter.executeCommandItem(AbstractCommandLineActorAdapter.java:362)

                          at com.realops.adapter.terminal.AbstractCommandLineActorAdapter.performAction(AbstractCommandLineActorAdapter.java:947)

                          at sun.reflect.GeneratedMethodAccessor1120.invoke(Unknown Source)

                          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

                          at java.lang.reflect.Method.invoke(Method.java:597)

                          at com.realops.common.util.proxy.ContextClassLoaderDecoratorFactory$IsolatedInvocationHandler.doInvoke

                 

                 

                (ContextClassLoaderDecoratorFactory.java:79)

                          at com.realops.common.util.proxy.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:89)

                          at $Proxy179.performAction(Unknown Source)

                          at com.realops.foundation.adapterframework.AdapterManager.performAction(AdapterManager.java:2474)

                          at com.realops.foundation.adapterframework.DefaultAdapterProxy.performActionImpl(DefaultAdapterProxy.java:408)

                          at com.realops.foundation.adapterframework.DefaultAdapterProxy.access$000(DefaultAdapterProxy.java:69)

                          at com.realops.foundation.adapterframework.DefaultAdapterProxy$1.run(DefaultAdapterProxy.java:432)

                          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

                          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

                          at java.lang.Thread.run(Thread.java:662)

                29 Aug 2011 07:33:32,791 ERROR AbstractCommandLineActorAdapter : [Thread=AMP - Perform Action Executor - 32][Adapter=SSHadapterOSCFW]

                 

                 

                [Adapter=SSHadapterOSCFW : Error closing invalid terminal connection. ERROR: Message[summary=Exception occured in Adapter :

                 

                 

                SSHadapterOSCFW. Error occured parsing command results. ERROR : , detail=Exception occured in Adapter : SSHadapterOSCFW. Error occured

                 

                 

                parsing command results. ERROR : ]]

                com.realops.adapter.terminal.connection.ConnectionException: Message[summary=Exception occured in Adapter : SSHadapterOSCFW. Error

                 

                 

                occured parsing command results. ERROR : , detail=Exception occured in Adapter : SSHadapterOSCFW. Error occured parsing command

                 

                 

                results. ERROR : ]

                          at com.realops.adapter.terminal.connection.MaverickSSHConnection.performCommand(MaverickSSHConnection.java:993)

                          at com.realops.adapter.terminal.AbstractCommandLineActorAdapter.executeCommand(AbstractCommandLineActorAdapter.java:475)

                          at com.realops.adapter.terminal.AbstractCommandLineActorAdapter.executeCommandItem(AbstractCommandLineActorAdapter.java:362)

                          at com.realops.adapter.terminal.AbstractCommandLineActorAdapter.performAction(AbstractCommandLineActorAdapter.java:947)

                          at sun.reflect.GeneratedMethodAccessor1120.invoke(Unknown Source)

                          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

                          at java.lang.reflect.Method.invoke(Method.java:597)

                          at com.realops.common.util.proxy.ContextClassLoaderDecoratorFactory$IsolatedInvocationHandler.doInvoke

                 

                 

                (ContextClassLoaderDecoratorFactory.java:79)

                          at com.realops.common.util.proxy.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:89)

                          at $Proxy179.performAction(Unknown Source)

                          at com.realops.foundation.adapterframework.AdapterManager.performAction(AdapterManager.java:2474)

                          at com.realops.foundation.adapterframework.DefaultAdapterProxy.performActionImpl(DefaultAdapterProxy.java:408)

                          at com.realops.foundation.adapterframework.DefaultAdapterProxy.access$000(DefaultAdapterProxy.java:69)

                          at com.realops.foundation.adapterframework.DefaultAdapterProxy$1.run(DefaultAdapterProxy.java:432)

                          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

                          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

                          at java.lang.Thread.run(Thread.java:662)

                Caused by: com.maverick.ssh.ChannelOpenException:

                          at com.maverick.ssh2.b.b(Unknown Source)

                          at com.maverick.ssh2.Ssh2Client.openSessionChannel(Unknown Source)

                          at com.maverick.ssh2.Ssh2Client.openSessionChannel(Unknown Source)

                          at com.realops.adapter.terminal.connection.MaverickSSHConnection.openSessionWithListener(MaverickSSHConnection.java:707)

                          at com.realops.adapter.terminal.connection.MaverickSSHConnection.openSession(MaverickSSHConnection.java:608)

                          at com.realops.adapter.terminal.connection.MaverickSSHConnection.sendCommand(MaverickSSHConnection.java:1056)

                          at com.realops.adapter.terminal.connection.MaverickSSHConnection.sendCommand(MaverickSSHConnection.java:1020)

                          at com.realops.adapter.terminal.connection.MaverickSSHConnection.performCommand(MaverickSSHConnection.java:915)

                          ... 16 more

                • 5. How to Use Orchestrator (AO) to execute commands on networking devices (e.g. Cisco)
                  Greg Bukowski

                  It's failing on the first command "enable".  If you were to SSH and run that command on the Cisco device, what would the output be?  Do you have the prompt setup properly in the adapter?

                  • 6. How to Use Orchestrator (AO) to execute commands on networking devices (e.g. Cisco)
                    Ranganath Samudrala

                    The request does not specify a target. So, it is using the target specified in the adapter configuration. What does the adapter configuration look like? Please note that prompts you specified in the request do not apply to the request, unless you specify it inside a <target> element.

                     

                    It will help if you enable debug on adapters and show log enries where the adapter is actually trying to invoke the request, not just the error message.

                    • 7. Re: How to Use Orchestrator (AO) to execute commands on networking devices (e.g. Cisco)

                      Hi Greg,

                       

                      I did change the command from "show vlan" to "show run aaa" since the other command doesn't work.

                       

                      This is how the output looks when I log into the device. You can also see the output from the command.

                       

                      Type help or '?' for a list of available commands.

                      LAB-FWSM-SUW/LAB-FW01-PRI-SUW> enable

                      Password: ********

                      LAB-FWSM-SUW/LAB-FW01-PRI-SUW# sh run aaa

                      aaa authentication ssh console LOCAL

                      aaa authentication http console LOCAL

                      LAB-FWSM-SUW/LAB-FW01-PRI-SUW#

                      • 8. Re: How to Use Orchestrator (AO) to execute commands on networking devices (e.g. Cisco)

                        Hi rsamudra,

                         

                        Please see adapter info below... I have already added the device IP and credentials. Also, how do I enable debug on the adapter?

                         

                        sshadapter.jpg

                        • 9. How to Use Orchestrator (AO) to execute commands on networking devices (e.g. Cisco)
                          Ranganath Samudrala

                          Ok - did a little bit of research, since I had not looked at this for a while.

                           

                          Your request should be changed a bit:

                           

                          <request-data>

                            <ssh-request>

                              <prompts>

                                <prompt name="first">LAB-FWSM-SUW/LAB-FW01-PRI-SUW></prompt>

                                <prompt name="second">Password:</prompt>

                                <prompt name="third">LAB-FWSM-SUW/LAB-FW01-PRI-SUW#</prompt>

                              </prompts>

                              <commands>

                                <command prompt="second"><![CDATA[enable]]></command>

                                <command prompt="third"><![CDATA[abc123]]></command>

                                <command prompt="third"><![CDATA[show vlan]]></command>

                              </commands>

                            </ssh-request>

                          </request-data>

                           

                          "prompt" should be interpreted as "expect". Meaning, "expect" string after issuing the command. It is a way to instruct the adapter to stop reading the response to the command after seeing the string specified in the "prompt" attribute.

                          • 10. Re: How to Use Orchestrator (AO) to execute commands on networking devices (e.g. Cisco)

                            I did change it, but still no luck. I was able to get the adapter to use debug (see results below). I wonder if AO thinks it is dealing with a Linux device because I see the command "Sending command [uname -s]" issued. I also notice that it says "os-id is null". In the Base Adapter PDF I did see "Cisco IOS" as an option but wouldn't know if it is needed here or even where to put it if it is needed.

                             

                             

                             

                            29 Aug 2011 12:28:53,125 INFO  AbstractCommandLineActorAdapter : [Thread=AMP - Perform Action Executor - 45][Adapter=SSHadapterOSCFW] perform operation start info log. Adapter request received <ssh-request>

                              <prompts>

                                <prompt name="first">LAB-FWSM-SUW/LAB-FW01-PRI-SUW&gt;</prompt>

                                <prompt name="second">Password:</prompt>

                                <prompt name="third">LAB-FWSM-SUW/LAB-FW01-PRI-SUW#</prompt>

                              </prompts>

                              <commands>

                                <command prompt="second"><![CDATA[enable]]></command>

                                <command prompt="third"><![CDATA[abc123!]]></command>

                                <command prompt="third"><![CDATA[show run aaa]]></command>

                              </commands>

                            </ssh-request> for adapter: SSHadapterOSCFW

                            29 Aug 2011 12:28:53,125 DEBUG AbstractCommandLineActorAdapter : [Thread=AMP - Perform Action Executor - 45][Adapter=SSHadapterOSCFW] Adapter request: <adapter-request>

                              <target-adapter>AdapterConfiguration1314133350286--1268026241</target-adapter>

                              <peer-location>

                                <location>any</location>

                              </peer-location>

                              <request-action />

                              <ttl>4611686018427387790</ttl>

                              <job-id>0aeca1b2167bddd2:464e84c1:13215f0af68:-80001-1314646133602</job-id>

                              <request-data>

                                <ssh-request>

                                  <prompts>

                                    <prompt name="first">LAB-FWSM-SUW/LAB-FW01-PRI-SUW&gt;</prompt>

                                    <prompt name="second">Password:</prompt>

                                    <prompt name="third">LAB-FWSM-SUW/LAB-FW01-PRI-SUW#</prompt>

                                  </prompts>

                                  <commands>

                                    <command prompt="second"><![CDATA[enable]]></command>

                                    <command prompt="third"><![CDATA[abc123!]]></command>

                                    <command prompt="third"><![CDATA[show run aaa]]></command>

                                  </commands>

                                </ssh-request>

                              </request-data>

                            </adapter-request>

                            29 Aug 2011 12:28:53,125 INFO  AbstractCommandLineActorAdapter : [Thread=AMP - Perform Action Executor - 45][Adapter=SSHadapterOSCFW] Request validation started

                            29 Aug 2011 12:28:53,125 DEBUG AbstractCommandLineActorAdapter : [Thread=AMP - Perform Action Executor - 45][Adapter=SSHadapterOSCFW] CommandNode=command; Command=enable; Command arguments: [os-id=null][os-version=null][os-arch=null][prompt=Password:][encryption-type=null][working-dir=null][command-dir=null][timeout-secs=null][ignore-exit-code=false][continue-on-failure=false][no-op=false][num-prompt-occurrences=null][line-termination=null][disable-line-termination=false][ignore-response=false][is-special-character=false][milli-second-timeout=null millisecs][run-as=false][user-name=null ][password=null ][wait-for-command-output=false ][krb-authentication=false ][krb-command=null ][krb-options=null ][read-buffer-size=0 ]

                            29 Aug 2011 12:28:53,125 DEBUG AbstractCommandLineActorAdapter : [Thread=AMP - Perform Action Executor - 45][Adapter=SSHadapterOSCFW] CommandNode=command; Command=abc123!; Command arguments: [os-id=null][os-version=null][os-arch=null][prompt=LAB-FWSM-SUW/LAB-FW01-PRI-SUW#][encryption-type=null][working-dir=null][command-dir=null][timeout-secs=null][ignore-exit-code=false][continue-on-failure=false][no-op=false][num-prompt-occurrences=null][line-termination=null][disable-line-termination=false][ignore-response=false][is-special-character=false][milli-second-timeout=null millisecs][run-as=false][user-name=null ][password=null ][wait-for-command-output=false ][krb-authentication=false ][krb-command=null ][krb-options=null ][read-buffer-size=0 ]

                            29 Aug 2011 12:28:53,125 DEBUG AbstractCommandLineActorAdapter : [Thread=AMP - Perform Action Executor - 45][Adapter=SSHadapterOSCFW] CommandNode=command; Command=show run aaa; Command arguments: [os-id=null][os-version=null][os-arch=null][prompt=LAB-FWSM-SUW/LAB-FW01-PRI-SUW#][encryption-type=null][working-dir=null][command-dir=null][timeout-secs=null][ignore-exit-code=false][continue-on-failure=false][no-op=false][num-prompt-occurrences=null][line-termination=null][disable-line-termination=false][ignore-response=false][is-special-character=false][milli-second-timeout=null millisecs][run-as=false][user-name=null ][password=null ][wait-for-command-output=false ][krb-authentication=false ][krb-command=null ][krb-options=null ][read-buffer-size=0 ]

                            29 Aug 2011 12:28:53,125 INFO  AbstractCommandLineActorAdapter : [Thread=AMP - Perform Action Executor - 45][Adapter=SSHadapterOSCFW] adapter request is valid.

                            29 Aug 2011 12:28:53,140 INFO  MaverickSSHConnection : establishing ssh connection to 10.201.26.12

                            29 Aug 2011 12:28:53,140 INFO  MaverickSSHConnection : establishing ssh connection with esablishment timeout 60 secs

                            29 Aug 2011 12:28:53,140 DEBUG TimeoutThread   : ssh:10.201.26.12:OpenConnectionWithTimeout:TimeoutThread Sleeping for 60000 millisecs

                            29 Aug 2011 12:28:53,468 DEBUG AOConnectionExpirationPolicy : [Thread: Whirlycache Tuner ( named_connection_cache-AdapterConfiguration1314133350286--1268026241 )]  Performing Maintenance at 2011-08-29 12:28:53.468

                            29 Aug 2011 12:28:53,468 DEBUG AOConnectionExpirationPolicy : [Thread: Whirlycache Tuner ( named_connection_cache-AdapterConfiguration1314133350286--1268026241 )]  Cache size: 0

                            29 Aug 2011 12:28:53,468 DEBUG AOConnectionExpirationPolicy : [Thread: Whirlycache Tuner ( named_connection_cache-AdapterConfiguration1314133350286--1268026241 )] Locking ManagedCache Object...........

                            29 Aug 2011 12:28:53,468 DEBUG AOConnectionExpirationPolicy : [Thread: Whirlycache Tuner ( named_connection_cache-AdapterConfiguration1314133350286--1268026241 )] Unlocking ManagedCache Object...........

                            29 Aug 2011 12:28:58,359 DEBUG MaverickSSHConnectionOpener : [Thread: ssh:10.201.26.12:ConnectionOpener] Supported auth methods:

                            29 Aug 2011 12:28:58,359 DEBUG MaverickSSHConnectionOpener : [Thread: ssh:10.201.26.12:ConnectionOpener] [1] password

                            29 Aug 2011 12:28:58,359 DEBUG MaverickSSHConnectionOpener : [Thread: ssh:10.201.26.12:ConnectionOpener]  using password authentication for user oscadmin

                            29 Aug 2011 12:28:58,359 DEBUG MaverickSSHConnectionOpener : [Thread: ssh:10.201.26.12:ConnectionOpener]  calling authenticate!

                            29 Aug 2011 12:28:58,359 DEBUG MaverickSSHConnectionOpener : [Thread: ssh:10.201.26.12:ConnectionOpener] Authentication successfull using :!password authentication

                            29 Aug 2011 12:28:58,359 DEBUG MaverickSSHConnectionOpener : [Thread: ssh:10.201.26.12:ConnectionOpener] ssh:10.201.26.12:ConnectionOpener  Exiting!

                            29 Aug 2011 12:28:58,359 DEBUG MaverickSSHConnection : This is network environment, so not creating a dummy session!

                            29 Aug 2011 12:28:58,359 DEBUG MaverickSSHConnection : Gathering environment information!

                            29 Aug 2011 12:28:58,359 DEBUG AbstractConnection : Attempting to determine OS type...

                            29 Aug 2011 12:28:58,359 DEBUG MaverickSSHConnection : Sending command [uname -s]

                            29 Aug 2011 12:28:58,359 DEBUG MaverickSSHConnection : Sending command [uname -s] with line termination[ 0x0a]

                            29 Aug 2011 12:28:58,359 DEBUG MaverickSSHConnection : Session is null or closed... opening it

                            29 Aug 2011 12:28:58,359 DEBUG MaverickSSHConnection : Opening session with listener - no prompt!

                            29 Aug 2011 12:28:58,359 DEBUG MaverickSSHConnection : Attempting to opening session channel!

                            29 Aug 2011 12:28:58,359 DEBUG TimeoutThread   : ssh:10.201.26.12:OpenConnectionWithTimeout:TimeoutThread Interrupted...Exiting!

                            29 Aug 2011 12:28:58,359 DEBUG MaverickChannelAdapter : SSH Channel with ID:0; opened!!

                            29 Aug 2011 12:28:58,359 DEBUG MaverickSSHConnection : Successfully opened session channel.

                            29 Aug 2011 12:28:58,359 DEBUG MaverickSSHConnection : Setting vt100 pseudoTerminal

                            29 Aug 2011 12:28:58,359 DEBUG MaverickSSHConnection : SSH opened session; ID=[0].

                            29 Aug 2011 12:28:58,359 DEBUG MaverickSSHConnection : SSH getResponse()... reading/listening

                            29 Aug 2011 12:28:58,578 DEBUG MaverickChannelAdapter : SSH Channel with ID:0; data received [Type help or '?' for a list of available commands.

                            ].

                            29 Aug 2011 12:28:58,578 DEBUG MaverickChannelAdapter : SSH Channel with ID:0; data received [Type help or '?' for a list of available commands.

                             

                             

                            LAB-FWSM-SUW/LAB-FW01-PRI-SUW> ].

                            29 Aug 2011 12:28:58,578 DEBUG MaverickChannelAdapter : SSH Channel with ID:0; data received [Type help or '?' for a list of available commands.

                             

                             

                            LAB-FWSM-SUW/LAB-FW01-PRI-SUW> u].

                            29 Aug 2011 12:28:58,578 DEBUG MaverickChannelAdapter : SSH Channel with ID:0; data received [Type help or '?' for a list of available commands.

                             

                             

                            LAB-FWSM-SUW/LAB-FW01-PRI-SUW> un].

                            29 Aug 2011 12:28:58,578 DEBUG MaverickChannelAdapter : SSH Channel with ID:0; data received [Type help or '?' for a list of available commands.

                             

                             

                            LAB-FWSM-SUW/LAB-FW01-PRI-SUW> una].

                            29 Aug 2011 12:28:58,578 DEBUG MaverickChannelAdapter : SSH Channel with ID:0; data received [Type help or '?' for a list of available commands.

                             

                             

                            LAB-FWSM-SUW/LAB-FW01-PRI-SUW> unam].

                            29 Aug 2011 12:28:58,578 DEBUG MaverickChannelAdapter : SSH Channel with ID:0; data received [Type help or '?' for a list of available commands.

                             

                             

                            LAB-FWSM-SUW/LAB-FW01-PRI-SUW> uname].

                            29 Aug 2011 12:28:58,578 DEBUG MaverickChannelAdapter : SSH Channel with ID:0; data received [Type help or '?' for a list of available commands.

                             

                             

                            LAB-FWSM-SUW/LAB-FW01-PRI-SUW> uname ].

                            29 Aug 2011 12:28:58,578 DEBUG MaverickChannelAdapter : SSH Channel with ID:0; data received [Type help or '?' for a list of available commands.

                             

                             

                            LAB-FWSM-SUW/LAB-FW01-PRI-SUW> uname -].

                            29 Aug 2011 12:28:58,578 DEBUG MaverickChannelAdapter : SSH Channel with ID:0; data received [Type help or '?' for a list of available commands.

                             

                             

                            LAB-FWSM-SUW/LAB-FW01-PRI-SUW> uname -s].

                            29 Aug 2011 12:29:01,984 DEBUG AOConnectionExpirationPolicy : [Thread: Whirlycache Tuner ( named_connection_cache-AdapterConfiguration1314192411900--700892357 )]  Performing Maintenance at 2011-08-29 12:29:01.984

                            29 Aug 2011 12:29:01,984 DEBUG AOConnectionExpirationPolicy : [Thread: Whirlycache Tuner ( named_connection_cache-AdapterConfiguration1314192411900--700892357 )]  Cache size: 0

                            29 Aug 2011 12:29:01,984 DEBUG AOConnectionExpirationPolicy : [Thread: Whirlycache Tuner ( named_connection_cache-AdapterConfiguration1314192411900--700892357 )] Locking ManagedCache Object...........

                            29 Aug 2011 12:29:01,984 DEBUG AOConnectionExpirationPolicy : [Thread: Whirlycache Tuner ( named_connection_cache-AdapterConfiguration1314192411900--700892357 )] Unlocking ManagedCache Object...........

                            • 11. How to Use Orchestrator (AO) to execute commands on networking devices (e.g. Cisco)
                              Ranganath Samudrala

                              Switch the adapter configuration to XML view and then add the following configuration parameter

                              <verify-os>false</verify-os>

                               

                              In the adapter request, for each command add the verify-os attribute as below:

                               

                                    <command verify-os="false" prompt="second"><![CDATA[enable]]></command>

                                    <command verify-os="false" prompt="third"><![CDATA[abc123]]></command>

                                    <command verify-os="false" prompt="third"><![CDATA[show vlan]]></command>

                              • 12. Re: How to Use Orchestrator (AO) to execute commands on networking devices (e.g. Cisco)

                                I have experienced this issue before when working with Cisco devices.  Try

                                adding this to your adapter-request: <verify-os>false</verify-os>

                                 

                                If you're using the out-of-the-box invoke-command or ssh adapter request you

                                may have to create your own.  If not, try adding this to each <command/>

                                element containing a command.

                                 

                                Kris-

                                • 13. Re: How to Use Orchestrator (AO) to execute commands on networking devices (e.g. Cisco)

                                  I tried adding <verify-os>false</verify-os> to the adapter's XML on the CDP. I also tried adding command verify-os="false" to all my commands. It looks like it still is trying to issue that "uname" command. When that didn't work, I I tried last...

                                   

                                  <command os-id="Cisco IOS" prompt="second">enable</command> 

                                  <command os-id="Cisco IOS" prompt="third">abc123!</command> 

                                  <command os-id="Cisco IOS" prompt="third">show run aaa</command>

                                   

                                  I still saw the uname trying to be applied even though the debug in the grid log said...

                                   

                                  [Adapter=SSHadapterOSCFW] CommandNode=command; Command=abc123!; Command arguments: [os-id=Cisco IOS][os-version=null][os-arch=null][prompt=LAB-FWSM-SUW/LAB-FW01-PRI-SUW#][encryption-type=null][working-dir=null][command-dir=null][timeout-secs=null][ignore-exit-code=false][continue-on-failure=false][no-op=false][num-prompt-occurrences=null]

                                   

                                  Should I be using another adapter... like the command line adapter or the "invoke command" adapter?

                                  • 14. Re: How to Use Orchestrator (AO) to execute commands on networking devices (e.g. Cisco)

                                    Kris did you ever get any adapter to work with Cisco devices?

                                    1 2 Previous Next