cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1567
Views
0
Helpful
4
Replies

EEM script doesn´t run as expected on IOS-XR for the ASR9000

darthur_12
Level 1
Level 1

Hi everyone!

 

I´m trying to run an EEM script using TCL language on an ASR device. This script works when a syslog event is detected and should goes down logical and physical interfaces (bundle-ethernet and TenGigE). However when script is activated, the logical interfaces goes down and the physical interfaces remain up. 

The script is like this:

 

::cisco::eem::event_register_syslog tag VECINDAD_B2B pattern {Bundle-Ether100.5 in area 0 from FULL to DOWN}
::cisco::eem::event_register_syslog tag VECINDAD_CORE pattern {Bundle-Ether34 in area 0 from FULL to DOWN}

::cisco::eem::trigger {
::cisco::eem::correlate event VECINDAD_B2B and event VECINDAD_CORE
} occurs 1 period 80

 

namespace import ::cisco::eem::*
namespace import ::cisco::lib::*

array set _mar_einfo [event_reqinfo_multi]

set _i 1
foreach _tag [list VECINDAD_B2B VECINDAD_CORE] {
if { [info exists _mar_einfo($_tag)] } {
set _event_tag$_i $_tag
array set arr_einfo_$_i $_mar_einfo($_tag)
incr _i
}
}


if [catch {cli_open} result] {
error $result $errorInfo
} else {
array set cli1 $result
}

if [catch {cli_exec $cli1(fd) "enable"} _cli_result] {
error $_cli_result $errorInfo
}

if [catch {cli_exec $cli1(fd) "configure terminal"} _cli_result] {
error $_cli_result $errorInfo
}

if [catch {cli_exec $cli1(fd) "interface TenGigE0/3/0/32"} _cli_result] {
error $_cli_result $errorInfo
}

if [catch {cli_exec $cli1(fd) "shutdown"} _cli_result] {
error $_cli_result $errorInfo
}

if [catch {cli_exec $cli1(fd) "interface BE1003"} _cli_result] {
error $_cli_result $errorInfo
}

if [catch {cli_exec $cli1(fd) "shutdown"} _cli_result] {
error $_cli_result $errorInfo
}

if [catch {cli_exec $cli1(fd) "interface BE1010"} _cli_result] {
error $_cli_result $errorInfo
}

if [catch {cli_exec $cli1(fd) "shutdown"} _cli_result] {
error $_cli_result $errorInfo
}

if [catch {cli_exec $cli1(fd) "interface BE1011"} _cli_result] {
error $_cli_result $errorInfo
}

if [catch {cli_exec $cli1(fd) "shutdown"} _cli_result] {
error $_cli_result $errorInfo
}

if [catch {cli_exec $cli1(fd) "interface BE1012"} _cli_result] {
error $_cli_result $errorInfo
}

if [catch {cli_exec $cli1(fd) "shutdown"} _cli_result] {
error $_cli_result $errorInfo
}

if [catch {cli_exec $cli1(fd) "interface TenGigE0/3/0/27"} _cli_result] {
error $_cli_result $errorInfo
}

if [catch {cli_exec $cli1(fd) "shutdown"} _cli_result] {
error $_cli_result $errorInfo
}

if [catch {cli_exec $cli1(fd) "interface TenGigE0/3/0/29"} _cli_result] {
error $_cli_result $errorInfo
}

if [catch {cli_exec $cli1(fd) "shutdown"} _cli_result] {
error $_cli_result $errorInfo
}

if [catch {cli_exec $cli1(fd) "show tech-support | file harddisk:diag.txt"} _cli_result] {
error $_cli_result $errorInfo
}


# Close open cli before exit.
catch {cli_close $cli1(fd) $cli1(tty_id)} result

 

I think that this script is really simple, but when is executed doesn´t work as we expected. 

 

We are running ASR9k with 7.1.2 

 

Regards!

 

4 Replies 4

Hello,

 

I think the problem might just be the syntax you are using, try a leading empty space for the physical interfaces.

 

So instead of:

 

interface TenGigE0/3/0/32

 

use:

 

interface TenGigE 0/3/0/32

 

Hello George!

We tried many syntax options including that one you proposed and it was the same result. 

 

Another tested options were:

 

"int Te 0/3/0/32"

"interface Te0/3/0/32"

"interface TenGigE 0/3/0/32"

"interface TenGigE0/3/0/32"

 

Thanks!

 

Hello,

 

are all the TenGE interfaces in your script member interfaces of the bundles ? 

 

Considering that: 

 

--> when you shut down a bundle interface, the member links are put into err-disable link interface status and admin-down line protocol state.

 

Can you adjust the script so it shuts down only the bundle interfaces (and not the physical interfaces) ?

Hi George!

 

The physical interfaces are not member of the bundles. In the topology I can´t just tear down the bundle interfaces. 

 

In conclusion, the physical interfaces are connected to differents devices than the bundles and I need to tear down all of them. 

 

Thanks.