Fibre Channel (SAN)

Reply
New Member
Posts: 1
Registered: ‎07-10-2014

We are embracing Powershell. Is there a Brocade Powershell Module? Is there a list of Brocade Powershell starter scripts?

I am in charge of making Powershell the Go To tool for our SAN environment.  What is Brocades official position on Powershell?  If Brocade is embracing the tool do we have a module available?  Do we have a list of starter scripts available?  I did not have any luck searching the web, please let me know if things were missed.

Contributor
Posts: 26
Registered: ‎07-15-2014

Re: We are embracing Powershell. Is there a Brocade Powershell Module? Is there a list of Brocade Powershell starter scripts?

[ Edited ]

I found only this script in this forum:

http://community.brocade.com/t5/Fibre-Channel-SAN/Capture-fibre-switch-port-errors-and-clear-errors-for-SAN-Health/ta-p/3403

 

I think the first problem ist to talk SSH via PowerShell. Therefor you can use this PowerShell Module:

http://www.powershelladmin.com/wiki/SSH_from_PowerShell_using_the_SSH.NET_library#Invoke-SshCommand

 

My goal is also to get some infos from Brocade SAN Switch with PowerShell. So far I have written this script, which isn't finished yet.

 

<deleted>

new version see last post

</deleted>

New Contributor
Posts: 3
Registered: ‎07-16-2014

Re: We are embracing Powershell. Is there a Brocade Powershell Module? Is there a list of Brocade Powershell starter scripts?

The above script looks very useful. Have you made any additonal progress to it, i am very interested in your efforts as do i think many other people will be. 

New Contributor
Posts: 3
Registered: ‎07-16-2014

Re: We are embracing Powershell. Is there a Brocade Powershell Module? Is there a list of Brocade Powershell starter scripts?

May i also ask what sort of values you stored in SSH-Sessions.psd1 which i assume contains "$SshSession"? 

Contributor
Posts: 26
Registered: ‎07-15-2014

Re: We are embracing Powershell. Is there a Brocade Powershell Module? Is there a list of Brocade Powershell starter scripts?

The psd1 file is the module for making ssh connections with powershell. This module is very userful! See also:

http://www.powershelladmin.com/wiki/SSH_from_PowerShell_using_the_SSH.NET_library#Invoke-SshCommand

 

Unfortunately I haven't made any progress with the script. The problem is with parsing the output from porterrshow, as I don't know any command to get that info for every port individually. So I have to parse the complete list in powershell, which I haven't finished yet.

New Contributor
Posts: 3
Registered: ‎07-16-2014

Re: We are embracing Powershell. Is there a Brocade Powershell Module? Is there a list of Brocade Powershell starter scripts?

AH! I understand now. I mistakenly thought that invoke-ssh was part of powershell.  I really appreciate you sharing what you have. I have some similar goals in mind but i wont be able to start on it for a while. 

Contributor
Posts: 26
Registered: ‎07-15-2014

Re: We are embracing Powershell. Is there a Brocade Powershell Module? Is there a list of Brocade Powershell starter scripts?

[ Edited ]

Here is a little update to the script:

 

<deleted>

see last post for the script

</deleted>

Contributor
Posts: 26
Registered: ‎07-15-2014

Re: We are embracing Powershell. Is there a Brocade Powershell Module? Is there a list of Brocade Powershell starter scripts?

[ Edited ]

I have made a few optimizations to the script. For example the sfpshow is used with "-all" instead of querying every sfp individually, which makes the script much faster. Also I have bugfixed some things for FabOS 7.

Also you can fill the variables in the beginning and can start with the script. I fill my variables with values from a global config script.

Contributor
Posts: 26
Registered: ‎07-15-2014

Re: We are embracing Powershell. Is there a Brocade Powershell Module? Is there a list of Brocade Powershell starter scripts?

[ Edited ]

At the moment I try to get the portnames with "portname". This works via SSH on all switches (6.4.2b and 7.2.0a), but when trying to get this information via PowerShell, I only get the values for the switches with the newer firmware.

Has anybody a solution to this?

 

SSH:

portname
port  2: storage1
port  3: server1
port  4: server2
...

 PowerShell:

PS D:\scripts> $SshSessions.$SwitchIP.RunCommand('portname')

CommandText          : portname
CommandTimeout       : -00:00:00.0010000
ExitStatus           : 127
OutputStream         : Renci.SshNet.Common.PipeStream
ExtendedOutputStream : Renci.SshNet.Common.PipeStream
Result               : 
Error                : rbash: portname: command not found

 

Contributor
Posts: 26
Registered: ‎07-15-2014

Re: We are embracing Powershell. Is there a Brocade Powershell Module? Is there a list of Brocade Powershell starter scripts?

[ Edited ]

So here is the script so far and I think it works fine so far.

 

[Script removed, as newer version exists, see below]

Join the Community

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

vADC is now Pulse Secure
Download FREE NVMe eBook