12: Scripts
EMG™ Edge Management Gateway User Guide
270
Expect Custom Script - EMG Device Port Session
An example of an Expect Custom Script that interacts with a EMG Device Port (in this example a
Cisco server is connected to a Device Port):
#! expect
#
# Save a copy of the running config of a Cisco server to a TFTP server
# The Cisco server is connected to an EMG device port
#
proc myprint {str} {
send_user -- "$str\n"
}
proc abortSession {err} {
send_user "Error $err. Terminating session.\n"
exit $err
}
if {$argc < 2} {
myprint "Usage: script_md_cisco.exp <TFTP Server> <Backup File Name>"
abortSession 1
}
set tftp [lindex $argv 0]
set configFile [lindex $argv 1]
set enablePassword "secret"
set timeout 10
set now [clock seconds]
set date [clock format $now -format {%D %R}]
myprint "Backing up Cisco Server to $tftp:$configFile at $date"
# spawn the port session on a device port
if {[catch {spawn -noecho portsession -p $devicePort} result]} {
abortSession 2
}
set sessionId $spawn_id
# Handle eof
expect_after {
-i $sessionId eof {
myprint "Session unexpectedly terminated."
abortSession 3
}
}
log_user 0
# Send carriage return, see if we are connected
set loggedIn false
set execMode false
Содержание EMG 7500
Страница 1: ...Part Number PMD 00008 Revision C April 2020 EMG Edge Management Gateway User Guide EMG 8500 EMG 7500 ...
Страница 82: ...7 Networking EMG Edge Management Gateway User Guide 82 Figure 7 2 Network Network Settings 2 of 2 ...
Страница 100: ...7 Networking EMG Edge Management Gateway User Guide 100 Figure 7 5 Network Wireless Settings ...
Страница 353: ...15 Maintenance EMG Edge Management Gateway User Guide 353 Figure 15 12 About EMG ...
Страница 474: ...EMG Edge Management Gateway User Guide 474 Figure E 3 EU Declaration of Conformity ...
Страница 475: ...EMG Edge Management Gateway User Guide 475 Figure E 4 EU Declaration of Conformity continued ...