Consolidated Platform Configuration Guide, Cisco Ios Release 15.2(4)E (Catalyst 2960-X Switches - Cisco Catalyst 2960 series Configuration Manual

Consolidated platform configuration guide, ios release 15.2(4)e
Hide thumbs Also See for Catalyst 2960 series:
Table of Contents

Advertisement

Configuration Examples for Writing Embedded Event Manager Policies Using Tcl
set rbuf ""
if {[llength $clist] < 1} {
return -code ok $rbuf
}
if {[catch {cli_open} result]} {
} else {
array set cliarr $result
}
if {[catch {cli_exec $cliarr(fd) "enable"} result]} {
}
if {[catch {cli_exec $cliarr(fd) "term length 0"} result]} {
}
foreach cmd $clist {
if {[catch {cli_exec $cliarr(fd) $cmd} result]} {
}
append rbuf $result
}
if {[catch {cli_close $cliarr(fd) $cliarr(tty_id)} result]} {
}
return -code ok $rbuf
}
proc run_cli_interactive { clist } {
set rbuf ""
if {[llength $clist] < 1} {
return -code ok $rbuf
}
if {[catch {cli_open} result]} {
} else {
array set cliarr $result
}
if {[catch {cli_exec $cliarr(fd) "enable"} result]} {
}
if {[catch {cli_exec $cliarr(fd) "term length 0"} result]} {
}
foreach cmd $clist {
if {[catch {cli_write $cliarr(fd) $sendexp(send)} result]} {
}
foreach response $sendexp(responses) {
}
if {[catch {cli_read $cliarr(fd)} result]} {
}
append rbuf $result
}
if {[catch {cli_close $cliarr(fd) $cliarr(tty_id)} result]} {
}
return -code ok $rbuf
}
array set arr_einfo [event_reqinfo]
set args $arr_einfo(argc)
set cmds [list]
for { set i 0 } { $i < $args } { incr i } {
set arg "arg${i}"
# Split each argument on the '^' character.
# the command, and each subsequent element is a prompt followed by

Consolidated Platform Configuration Guide, Cisco IOS Release 15.2(4)E (Catalyst 2960-X Switches)

1822
return -code error $result
return -code error $result
return -code error $result
return -code error $result
puts "WARNING: $result"
return -code error $result
return -code error $result
return -code error $result
array set sendexp $cmd
return -code error $result
array set resp $response
if {[catch {cli_read_pattern $cliarr(fd) $resp(expect)} result]} {
return -code error $result
}
if {[catch {cli_write $cliarr(fd) $resp(reply)} result]} {
return -code error $result
}
return -code error $result
puts "WARNING: $result"
The first element is

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents