Hello ,
I need to know how to call tcl script from remote tftp server to excute in VTY for autocommand .
my server ip is 172.17.8.19 and tcl script is lying in xyzauto folder , i have chnage the access and the access rights on linux server as below .
-rwxrwxrwx
and the folder has access
drwxrwxrwx
kindly assist me on priority
and tcl file is as below
::cisco::eem::event_register_none
#
# Namespace imports
#
namespace import ::cisco::eem::*
namespace import ::cisco::lib::*
#
#
proc CLICmdProc {cmds} {
if [catch {cli_open} result] {
error $result $errorInfo
} else {
array set cli1 $result
}
if [catch {cli_exec $cli1(fd) "enable"} result] {
error $result $errorInfo
}
if [catch {cli_exec $cli1(fd) "term len 0"} result] {
error $result $errorInfo
}
foreach a_cmd $cmds {
if [catch {cli_exec $cli1(fd) $a_cmd} result] {
error $result $errorInfo
} else {
lappend cmd_output $result
}
}
if [catch {cli_close $cli1(fd) $cli1(tty_id)} result] {
error $result $errorInfo
}
return $cmd_output
}
#
# Put commands here
#
# enhancement - read them from a file
#
lappend clicmd "term len 0"
lappend clicmd "sho run"
#
set cliout [CLICmdProc $clicmd]
#
# write to a file
#
#
if [file exists $_ofilename] {
puts "file $_ofilename being overwritten"
}
set myfileid [open $_ofilename w+]
foreach outs $cliout {
puts $myfileid $outs
}
close $myfileid