11: Scripts
EMG™ Edge Management Gateway User Guide
230
emgPrompt = ""
numPorts = 0
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 == 2: # SLC8000 model number
model = p.match.group(1)
numPorts = int(model)
elif i == 3: # SLB882 model number
numPorts = 8
elif i == 4: # prompt
loggedIn = True
slcPrompt = p.match.group(1).decode('utf-8')
if numPorts == 0:
print("Cannot determine number of device ports.")
p.terminate(True)
sys.exit(1)
print("Number of device ports:", numPorts)
# Terminate the CLI session
p.sendline("logout")
time.sleep(.500)
p.wait()
skipPorts = False
devicePort = 1
pList = []
if numPorts == 24 or numPorts == 40:
# Adjust port numbering for SLC8024 and SLC8040
skipPorts = True
numPorts = nu 8
# Loop through device ports, connect and try to detect the prompt
while devicePort <= numPorts:
if skipPorts and devicePort >= 9 and devicePort <= 16:
devicePort = devi 1
pList.append('')
continue
Содержание EMG 8500
Страница 1: ...Part Number PMD 00008 Revision A October 2019 EMG Edge Management Gateway User Guide EMG 8500 ...
Страница 69: ...6 Networking EMG Edge Management Gateway User Guide 69 Figure 6 2 Network Network Settings 2 of 2 ...
Страница 302: ...14 Maintenance EMG Edge Management Gateway User Guide 302 Figure 14 12 About EMG ...