4. Follow these steps to install BNClient:
© Copyright Lenovo 2016
As a python script:
a. Enter the following command for help:
python C:\bladenetconfpythonclientv0.1\bladenetconfpython
client\bnclient\bnclient.py –h
b. Enter the following command to establish a NETCONF session:
Using SSH to connect to default port 830:
python C:\bladenetconfpythonclientv0.1\bladenetconfpython
client\bnclient\bnclient.py {switch IP address} –u admin –p admin –o
get
Using SSH to connect to port 22:
python C:\bladenetconfpythonclientv0.1\bladenetconfpython
client\bnclient\bnclient.py {switch IP address}:22 –u admin –p admin –o
get
As a python library:
a. Open the file
C:\bladenetconfpythonclientv0.1\bladenetconf
pythonclient\example\get.py in a Python editor (For example, IDLE).
b. Change the IP address in the hostname field to the switch IP address, and save
the file.
c. Enter the following command to establish a session:
python C:\bladenetconfpythonclientv0.1\bladenetconfpython
client\setup.py install
d. Enter the following command to get the running configuration:
python C:\bladenetconfpythonclientv0.1\bladenetconfpython
client\example\get.py
Note: The file get.py is an example of a NETCONF operation python script. You
can edit the script or write a new script as per your requirements.
667
Chapter 43: NETCONF