EasyManuals Logo
Home>Lantronix>Switch>SLC 8000 Series

Lantronix SLC 8000 Series User Manual

Lantronix SLC 8000 Series
425 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #220 background imageLoading...
Page #220 background image
9: Device Ports
SLCâ„¢ 8000 Advanced Console Manager User Guide 220
continue
print("Detected prompt", devPrompt, ".")
# Strip characters not allowed in DP names
devPromptStrip = re.sub("[^0-9A-Za-z\._\-]", "", devPrompt)
devPromptComplete = devPromptStrip + "-" + str(devicePort)
pList.append(devPromptComplete)
p.terminate(True)
p.wait()
devicePort = devicePort + 1
# end of while devicePort <= numPorts:
# Connect to the SLC CLI and set the device port names
p=pexpect.spawn('clisession -U sysadmin')
loggedIn = False
while not loggedIn:
i = p.expect([pexpect.TIMEOUT, pexpect.EOF,
'Model Number: SLC80(\d*)\r\n', 'Model Number:
SLB882\r\n',
'(\[.*>)'], timeout=10)
if i == 0: # Timeout
print("Timeout waiting to login.")
p.terminate(True)
sys.exit(1)
elif i == 1: # EOF
print("Session unexpectedly terminated.")
p.terminate(True)
sys.exit(1)
elif i == 4: # prompt
loggedIn = True
devicePort = 1
while devicePort <= numPorts:
if skipPorts and devicePort >= 9 and devicePort <= 16:
devicePort = devicePort + 1
continue
if len(pList[devicePort - 1]) > 0:
# Detected a prompt; set it
print("Setting name on DP", devicePort, "to", pList[devicePort -
1], "...")
s = "set deviceport port " + str(devicePort) + " name " +
pList[devicePort - 1]
p.sendline(s)
i = p.expect([pexpect.TIMEOUT,
'Device Port settings successfully updated.\r\n'],
timeout=10)
if i == 0: # Timeout
print("Timeout waiting for response.")
devicePort = devicePort + 1
# Terminate the CLI session
p.sendline("logout")

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Lantronix SLC 8000 Series and is the answer not in the manual?

Lantronix SLC 8000 Series Specifications

General IconGeneral
BrandLantronix
ModelSLC 8000 Series
CategorySwitch
LanguageEnglish

Related product manuals