
8: Device Ports
SLB™ Branch Office Manager User Guide
159
while True:
output_str = proc.stdout.readline()
if b'RADIUS settings successfully updated' in output_str:
break
elif b'set radius' not in output_str:
# RADIUS command returned an error
s1 = str(output_str)
s2 = s1.split("\\r")[1]
print("RADIUS command returned: " + s2.split("\\n")[0])
proc.stdin.close()
proc.terminate()
proc.wait()
sys.exit(1)
proc.stdin.write(b'set radius state enable\n')
proc.stdin.flush()
while True:
output_str = proc.stdout.readline()
if b'RADIUS settings successfully updated' in output_str:
break
elif b'set radius' not in output_str:
# RADIUS command returned an error
s1 = str(output_str)
s2 = s1.split("\\r")[1]
print("RADIUS command returned: " + s2.split("\\n")[0])
proc.stdin.close()
proc.terminate()
proc.wait()
sys.exit(1)
print("RADIUS settings updated and enabled.")
proc.stdin.close()
proc.terminate()
proc.wait()
sys.exit(0)
Python Custom Script - SLB CLI Session
An example of a Python Custom Script that uses the Pexpect module to interact with the CLI
session and the device ports to detect the prompt on any devices connected to the SLB, and set
the device port name to be the same as the device prompt:
#! python
# Script to detect the prompt on a device connected to a SLC or SLB
device port,
# and set the device port name to the prompt. Punctuation characters are
# removed and the device port number is appended to the name. Prompts
ending
# in '>' are detected. For example, for a Cisco device attached to device
# port 3 and displays this prompt:
# engcisco_cat3560>
# the name for device port 3 will be set to "engcisco_cat3560-3"
Summary of Contents for 100-120 VAC SLB
Page 114: ...8 Device Ports SLB Branch Office Manager User Guide 114 Figure 8 4 Device Ports Settings ...
Page 131: ...8 Device Ports SLB Branch Office Manager User Guide 131 Figure 8 10 Devices Power Outlets ...
Page 174: ...9 USB Port SLB Branch Office Manager User Guide 174 Figure 9 3 Devices USB Modem ...