cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2469
Views
0
Helpful
1
Replies

asr 9000 ios_xr_4.0.3 cli_open problem

ercintorun
Level 1
Level 1

Hi everyone,

my problem is with cli variables. i wrote a script to remove or add a static route depending on a track status. my problem is that whenever the script starts to work, it could not recognize the "cli_open" variable like it's not reading from the variable from eem cli_library.

even when i try  a basic scirpt i am getting the same error.

------SCRIPT

::cisco::eem::event_register_none

namespace import ::cisco::eem::*

namespace import ::cisco::lib::*

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) "configure terminal"} result] {

error $result $errorInfo

}

if [catch {cli_exec $cli1(fd) "router static address-family ipv4 unicast"} result] {

error $result $errorInfo

}

if [catch {cli_exec $cli1(fd) "30.30.30.30/32 192.1.1.6"} result] {

error $result $errorInfo

}

if [catch {cli_exec $cli1(fd) "commit"} result] {

error $result $errorInfo

}

if [catch {cli_close $cli1(fd) $cli1(tty_id)}

result] {

error $result $errorInfo

}

-------------

-------------

The configuration eem:

event manager policy track20.tcl username test persist-time 3600

event manager directory user policy disk0:

------The error message:

RP/0/RSP1/CPU0:Nov 21 09:59:54.453 : object_tracking[271]: %SERVICES-OT-6-TRACK_INFO : track 20 state Track_Down

RP/0/RSP1/CPU0:Nov 21 09:59:55.628 : tclsh[65837]: %HA_EM-6-LOG: track20.tcl: track20 state is down,  20.20.20.20/32 static route is getting removed.

RP/0/RSP1/CPU0:Nov 21 09:59:55.685 : syslog_dev[93]: noscan: error reading the first prompt: Host name is not configured

RP/0/RSP1/CPU0:Nov 21 09:59:55.685 : syslog_dev[93]: noscan:     while executing

RP/0/RSP1/CPU0:Nov 21 09:59:55.685 : syslog_dev[93]: noscan: "cli_open"

RP/0/RSP1/CPU0:Nov 21 09:59:55.685 : syslog_dev[93]: noscan:     (procedure "CLICfgProc" line 3)

RP/0/RSP1/CPU0:Nov 21 09:59:55.685 : syslog_dev[93]: noscan:     invoked from within

RP/0/RSP1/CPU0:Nov 21 09:59:55.685 : syslog_dev[93]: noscan: "CLICfgProc $Rstatic"

RP/0/RSP1/CPU0:Nov 21 09:59:55.685 : syslog_dev[93]: noscan:     invoked from within

RP/0/RSP1/CPU0:Nov 21 09:59:55.685 : syslog_dev[93]: noscan: "if {$trackstat=="Down"} {

RP/0/RSP1/CPU0:Nov 21 09:59:55.685 : syslog_dev[93]: noscan:     action_syslog msg "

track20 state is down,  20.20.20.20/32 static route is getting removed. "

RP/0/RSP1/CPU0:Nov 21 09:59:55.685 : syslog_dev[93]: noscan:     CLICfgProc $Rstatic

RP/0/RSP1/CPU0:Nov 21 09:59:55.685 : syslog_dev[93]: noscan:     ac..."

------

1 Reply 1

ercintorun
Level 1
Level 1

i've figured out the problem. the device is a test router and no one has given the router a hostname. without a hostname the tcl does not work.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: