Find Communities by: Category | Product
pyFOS - Python module for Brocade Fabric OS
I found Brocade (Broadcom) provides python module to access Fabric OS. This is experimental but it's
interesting approach for user land. I'm going to introduce a few examples.
As Feb/22/2018, version is 0.9.0 and experimental. You can obtain from gitHub with your own risk.
You can find following statements in README file when you pull,
PyFOS - This is a prototype release of PyFOS. The code have only gone through developer unit testing only.
/*** Kanji document is also available ***/
You need following environment to play with pyFOS.
1. Any Brocade switches running later than FOS 8.2.0.
2. Python 3.x environment (I use Debian 9.3 with python3 package)
How to install pyFOS:
1. Get pyFOS copy from gitHub. (Current release is 0.9.0 - Feb/22/2018)
You can get copy without git(1) envioronment bellow,
2. Unzip copy to your favorite directory.
3. README file describes installation instructions bellow,
1) create library directories
2) set env variable for library directory
setenv PYTHONPATH ~<login>/python_lib/lib/python3.5/site-packages
3) install pyfos modules into the library path
cd <pyfos directory>
python3 setup.py install --prefix=~<login>/python_lib
I experienced a problem at step 3.
Set PYTHONUSERBASE environment variable same as PYTHONPATH. and ran,
"python3 setup install --user"
1. Added pyFOS directory to os.path.
2. Performed just "login" and "logout" without error handling. pyfos_auth module includes login and logout.
3. Getting switch information
There are 2 classes - fabric_switch and fibrechannel_switch. Those 2 classes have similar members.
fabric_switch class is read-only but fibrechannel_switch is read/write. pyfos_utils.response_print(response)
reads all members and peek_xxxxx() for single member.
3-1-1. fabric_switch class
3-1-2. fibrechannel_switch class
3-2. indivisual members (ie. DomainID, FOS version, switchModel)
peek_model() for fabric_switch class got error because there are no members for model number in fabric_switch class.
4. Get port information
FC port class for ports information. It is maybe mainly used for setting each ports.
Bellow example showed just read each members using pyfos_utils.reponse_print(response).
Let's enjoy with your own environment !