
9: Device Ports
SLC™ 8000 Advanced Console Manager User Guide
206
Note:
For CLI sessions, a local user name should be given
For Device Port sessions, the $devicePort variable will be used by the SLC to connect
the script to the appropriate Device Port. The
-noecho
flag may be passed to
spawn
command.
Expect script - CLI session
spawn clisession -U <username>
Expect script - Device Port session
spawn portsession -p $devicePort
Tcl script - CLI session
set io [open "| clisession -U <username>" r+]
Tcl script - Device Port session
set io [open "| portsession -p $devicePort" r+]
Python script - CLI session
subprocess.Popen(['clisession', '-U', '<username>'],
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
Python script - Device Port session
subprocess.Popen(['portsession', '-p', devicePort],
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
5. It is recommended that scripts that spawn clisession only be used with the
set script
runcli
command (and not the
connect script
command), and that scripts that spawn
portsession only be used with the
connect script
command (and not the
set script
runcli
command).
6. The script cannot contain commands which spawn or fork other commands, read or write files
on the SLC filesystem, or interrogate the SLC filesystem. The list of commands that are not
allowed for Expect scripts includes
"fork", "open", "exp_open", "exec",
"system", "log_file", "pwd"
.
7. For scripts that return an exit code, the SLC will interpret an exit code of zero as a successful
exit code, and any non-zero exit code as an error. Non-zero exit codes are displayed (at the
CLI) or logged (for scripts that are run by the script scheduler).
Example Scripts
Interface Script—Monitor Port
The Monitor Port (Monport) script connects directly to a device port by logging into the SLC
port,
gets the device hostname, loops a couple of times to get port interface statistics, and logs out. The
following is the script:
set monPort 7
set monTime 5
Содержание SLC 8000 Series
Страница 1: ...Part Number 900 704 R Revision R November 2019 SLC 8000 Advanced Console Manager User Guide ...
Страница 72: ...6 Basic Parameters SLC 8000 Advanced Console Manager User Guide 72 Figure 6 2 Network Network Settings 2 of 2 ...
Страница 88: ...6 Basic Parameters SLC 8000 Advanced Console Manager User Guide 88 Figure 6 7 Network VPN 1 of 2 ...
Страница 149: ...8 USB SD Card Port SLC 8000 Advanced Console Manager User Guide 149 Figure 8 4 Devices USB Modem ...
Страница 174: ...9 Device Ports SLC 8000 Advanced Console Manager User Guide 174 Figure 9 8 Device Ports RPMs Add Device ...
Страница 313: ...13 Maintenance SLC 8000 Advanced Console Manager User Guide 313 Figure 13 12 About SLC ...