11: Scripts
EMG™ Edge Management Gateway User Guide
220
}
}
#Get hostname info
send "show network port 1 host\r"
expect {
timeout { send_user "Time out Getting Hostname 1\r\n"; return }
"Domain" {
#Get Hostname from EMG
set hostname "[string range $expect_out(buffer) [string first
Hostname:
$expect_out(buffer)] [expr [string first Domain
$expect_out(buffer)]-2]]"
}
}
send_user "\r\n\r\n\r\n\r\n"
send_user "Device [string toupper $hostname]\r\n"
send_user "________________________________________________________\r\n"
send_user "Monitored Port: Port $monPort \r\n"
send_user "Monitor Interval Time: $monTime Seconds \r\n"
set loopCtr 0
set loopMax 2
while { $loopCtr < $loopMax } {
#Get current time
The following is the screen output:
emg247]> conn script ex4 deviceport 7
login: Logging in.... sysadmin sysadmin
Password: PASS
Welcome to the Lantronix Edge Management Gateway
Model Number: EMG851101
For a list of commands, type 'help'.
[EMG251]> show network port 1
host show network port 1 host
___Current Hostname Settings____________________________________________
Hostname: EMG251
Domain: support.int.lantronix.com
[EMG251 Device HOSTNAME: EMG251
________________________________________________________________________
Monitored Port: Port 7
Monitor Interval Time: 5 Seconds
[Current Time:21:16:43]
show portcounter deviceport 7
[EMG251]> show portcounter deviceport 7
Device Port: 7 Seconds since zeroed: 1453619
Bytes input: 0 Bytes output: 0
Framing errors: 0 Flow control errors: 0
Overrun errors: 0 Parity errors: 0
[EMG251]>
[Current Time:21:16:58]
show portcounter deviceport 7
show portcounter deviceport 7
Device Port: 7 Seconds since zeroed: 1453634