EasyManuals Logo

Lantronix EMG 8500 User Manual

Lantronix EMG 8500
482 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 #278 background imageLoading...
Page #278 background image
12: Scripts
EMGâ„¢ Edge Management Gateway User Guide 278
Tcl Custom Script - EMG CLI Session
An example of a Tcl Custom Script that interacts with a CLI session:
#! tcl
# Script to get the current internal temperature of the EMG
# Accepts one optional command line parameter for location
set emgTemp "unknown"
set location ""
# Are there any command line parameters?
if {$argc > 0} {
set location [lindex $argv 0]
}
set now [clock seconds]
set date [clock format $now -format {%D %R}]
if {$argc > 0} {
puts "Internal temperature of the $location EMG at $date"
} else {
puts "Internal temperature of the EMG at $date"
}
set io [open "| clisession -U sysadmin" r+]
set loggedIn false
while {! $loggedIn} {
set len [gets $io line]
if {[string first "Invalid local user" $line] != -1} {
puts "Invalid local user passed to clisession"
break
}
if {[string first "For a list of commands" $line] != -1} {
puts $io "\n"
flush $io
}
if {[string first ">" $line] != -1} {
set loggedIn true
}
}
if {! $loggedIn} {
exit 1
}
puts $io "show temp"
flush $io
set gotTemp false
while {! $gotTemp} {
set len [gets $io line]
if {[string first "Current Internal Temperature" $line] != -1} {
set emgTemp [string range $line [expr {[string first ":" $line] +
1}] end]

Table of Contents

Other manuals for Lantronix EMG 8500

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Lantronix EMG 8500 and is the answer not in the manual?

Lantronix EMG 8500 Specifications

General IconGeneral
BrandLantronix
ModelEMG 8500
CategoryGateway
LanguageEnglish

Related product manuals