Fibre Channel (SAN)

Reply
Occasional Contributor
Posts: 5
Registered: ‎10-31-2011

plink (posterrshow/poststatsclear)

Hello

I try to setup a daily automated postshow/poststatsclear with plink.

The postshow command is working fine:

e.g. plink.exe ip -pw password -l user  porterrshow > D:\logs\%date:~6,4%%date:~3,2%%date:~0,2%\SAN80B_A1.log

The poststatsclear command is not working:

e.g. plink.exe ip -pw password -l user portstatsclear -i 0-79

--> rbash: portstatsclear: command not found

The same command is working finde when I login manually with putty and run the command.

Any ideas whats the problem?

Regular Contributor
Posts: 178
Registered: ‎04-21-2008

Re: plink (posterrshow/poststatsclear)

Hi -

user "user" is not granted to run such cli as portstatsclear. Try as "admin" user, it will work.

Kind regards,

--

david

Occasional Contributor
Posts: 5
Registered: ‎10-31-2011

Re: plink (posterrshow/poststatsclear)

Hi

When I run the cmd with the same user on putty it works fine.

Regular Contributor
Posts: 178
Registered: ‎04-21-2008

Re: plink (posterrshow/poststatsclear)

strange because user 'user' has read only access by default. And portstatsclear is not read only as it's resetting counters.

Maybe it depends on FOS version. Which version are you using ?

Under 6.4 :

sw:user> portstatsclear
RBAC permission denied.

Hope this helps

Kind regards,

--

david

Occasional Contributor
Posts: 5
Registered: ‎10-31-2011

Re: plink (posterrshow/poststatsclear)

I have FOS v6.4.1b.

I use a user which have the needed privileges, I just replaced the original username with "user" in this thread. :-)

As I said it works with putty but not with plink (same user), strange thing..

edit: I get "portstatsclear: command not found" and not "portstatsclear: permission denied".

Occasional Contributor
Posts: 5
Registered: ‎10-31-2011

Re: plink (posterrshow/poststatsclear)

I found some old threads in this forum with the same problem.

There's a workaround but it's not working either..

plink.exe 10.101.19.205 -pw password -l user bash -login -c 'PATH=/fabos/abin:/fabos/sbin:/fabos/bin  portstatsclear -i 0-79'

--> rbash: bash: command not found

Any ideas how to fix/workaround this issue??

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

Re: plink (posterrshow/poststatsclear)

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.2.xx and few v5.5.xx. PLease share some inputs

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

Re: plink (posterrshow/poststatsclear)

Hi abhishek

 

try the following if the "switchstatusshow" do not work in the command, it should work if "switchstatusshow" does not work, but the command works by itself.

 

echo "switchstatusshow;logoout" | plink.exe <IP Addr> -pw <pwd> -l admin   

 

I have attached a list of test / work around up to 7.0 for plink/ssh

 

### 5.0 / 5.1 / 5.2


plink -pw password admin@192.168.11.20 "firmwareshow"
Primary partition: v5.0.5e
Secondary Partition: v5.1.0d

 

### 5.3 / 6.0 / 6.1

 

plink -pw password admin@172.27.75.150 "bash --login -c 'firmwareshow'"
Appl Primary/Secondary Versions
------------------------------------------
FOS v5.3.0d
    v5.3.0d

 

### 6.2 / 6.3 / 6.4 / 7.0

 

plink -pw password admin@172.27.75.153 "firmwareshow"
Appl Primary/Secondary Versions
------------------------------------------
FOS v6.2.0b
    v6.2.0b

 

### A general work around would also be


echo "firmwareshow;logout" | plink -pw password admin@172.27.75.153

 

or using echo

 

(echo setcontext 45 && echo switchshow && echo logout) | plink -batch -pw password admin@172.27.75.153

 

or having a file with command in - for example for VF. Do not forget to add exit or logout at the end to avoid hanging process.


>type cmd.txt
setcontext 128
firmwareshow
logout
^D
>plink -batch -pw password admin@172.27.75.153 < cmd.txt

 

 

 




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.