Fibre Channel (SAN)

Reply
New Contributor
Posts: 3
Registered: ‎01-07-2009

Noninteractive executing of command through ssh or telnet

Hi, have somebody found howto execute noninteractive 1 command through ssh or telnet on brocade?

I need execute just one info command from my batch in the way as is usual in SSH : ssh -pw password user@10.10.10.10 switchshow.

On brocade ssh fails with rbash: switchshow: command not found, it works only by connecting and writing command by hand.

Also with telnet I am able execute command only interactive but not by batch.

I had not these problems on McData but with brocade I can not find solution.

Tnx

Roman

Occasional Contributor
Posts: 19
Registered: ‎01-12-2009

Re: Noninteractive executing of command through ssh or telnet

I don't know what type of system you're trying to connect from  If it's a linux box you can use an expect script to do the login and run the commands.

I'm not 100% but you could probably capture that output as well.

New Contributor
Posts: 3
Registered: ‎01-07-2009

Re: Noninteractive executing of command through ssh or telnet

I am connecting from Win stations.

Now I found some ways for connecting by telnet but I prefer use ssh it´s 2009 not 1989.

I detected that If I execute command noninteractively there is different environment - I can execute pure linux commands, but after interactive connecting

I am accesing fos interpreter.

So if connect interactive there is in time of login executed fos interpreter, but in noninteractive maneer nothing and because of restricted shell,

I can not leave my directory to execute fos interpreter manually.

N/A
Posts: 1
Registered: ‎06-14-2007

Re: Noninteractive executing of command through ssh or telnet

I have FABOS 5.3

I'm using expect and following syntax

ssh -ax admin@switch "bash --login -c \"command\""

The problem is that when you do an ssh you just enter an restricted shell and brocade sets its environment variables in the login shell so you force bash into a login shell.

I have tried using ssh key authentication but had some problems don't remember them, but I figured expect might be just as good.

Can anyone verify this works on 6.x versions of FABOS BTW

New Contributor
Posts: 3
Registered: ‎01-07-2009

Re: Noninteractive executing of command through ssh or telnet

Tnx a lot, it's exact I'm finding.

It works for me on v6.0.1a.

New Contributor
Posts: 2
Registered: ‎01-06-2017

Re: Noninteractive executing of command through ssh or telnet

Anyone got this issue resolved.? I have tried with the previous suggested command, but no luck. The o/p is not coming.

 

plink.exe <IP Addr> -pw <pwd> -l admin bash -login -c 'PATH=/fabos/abin:/fabos/sbin:/fabos/bin  switchstatusshow'

 

Mine is on windows platform and brocade OS v6.0.xx and few v5.5.xx. PLease share some inputs

Brocade Moderator
Posts: 231
Registered: ‎03-29-2011

Re: Noninteractive executing of command through ssh or telnet

See reply in thread http://community.brocade.com/t5/Fibre-Channel-SAN/plink-posterrshow-poststatsclear/m-p/27340



If this provided you with a solution to this issue, please mark it with the button at the bottom "Accept as solution".

Any and all information provided by me is not reviewed, approved or endorsed by Brocade and is provided solely as a convenience for Brocade customers. All systems and all networks are different and unique. If you have a service affecting network problem, please open a TAC service request for service through Brocade, or through your OEM equipment provider. If this provided you with a solution to this issue, please mark it with the button at the bottom "Accept as solution"

Join the Community

Get quick and easy access to valuable resource designed to help you manage your Brocade Network.