Hi,
Again (and my apologies if it was not clear the first time!), the ICX does not support issuing ironware commands such as 'show version' etc, outside of an actual login shell. When you issue 'ssh .. ' you are authenticating over ssh, but not explicitly starting a shell on the device. Secure copy is a special case.. why? because when you launch 'scp' on your ssh client, the 'client-side' is the Linux/windows device, and the ICX needs to respond as an scp 'server' (as opposed to 'show version' etc where the ICX needs to act as both client and server for the command/response). Since the ICX does not support remote commands unless executed as a client from a local shell, the only 'server' command it will support is an scp request.. hence why you see the error!
Now, as to your particular issue. Since you need to launch a shell to run a command, there are many ways you can script this. I have written a very quick example of how you could do this with python/pexpect, but there are lots of other ways to accomplish this if you prefer other languages:
Call the script 'myscript.py' or whatever, and issue 'python myscript.py'
to run. I hope this helps?
######################################################
import pexpect
import time
import os
import getpass
MY_CMD = 'traceroute 1.1.1.1 numeric'
def get_params():
icx_user = raw_input('Enter username: ')
icx_password = getpass.getpass()
icx_host = raw_input('Enter Host: ')
return icx_user,icx_password, icx_host
def icx_session(icx_user, icx_password, icx_host):
# Spawn a session
icx_s = pexpect.spawn('ssh '+icx_user+'@'+icx_host)
icx_s.expect('word')
icx_s.sendline(icx_password)
icx_s.expect('#')
icx_s.sendline('skip')
icx_s.expect('#')
icx_s.sendline(MY_CMD)
icx_s.expect('#')
my_out = icx_s.before
icx_s.sendline('exit')
icx_s.expect('>')
icx_s.sendline('exit')
icx_s.expect('$')
icx_s.close
return my_out
p1,p2,p3 = get_params()
print icx_session(p1,p2,p3)
#######################################################