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

Tcl script to correlate between two events

Hello,

I am new with Tcl and EEM and I hope that you help me.

I have the following script that correlate between two events (check if two interfaces are up) and if it finds that the two interfaces are up, it will brings up another interface

I writed the following script:

::cisco::eem::event_register_interface tag Gig0 name GigabitEthernet0/0/0/0 parameter receive_rate_bps entry-op gt entry-val 10 entry_val_is_increment FALSE entry-type value
::cisco::eem::event_register_interface tag Gig1 name GigabitEthernet0/0/0/1 parameter receive_rate_bps entry-op gt entry-val 10 entry_val_is_increment FALSE entry-type value
::cisco::eem::trigger {

    ::cisco::eem::correlate event Gig0 and event Gig1

}
namespace import ::cisco::eem::*
namespace import ::cisco::lib::*
#open a cli connection
if [catch {cli_open} result] {
    error $result $errorInfo
} else {
    array set cli1 $result
}
#Perform the needed actions 
if [catch {cli_exec $cli1(fd) "configure"} result] {
error $result $errorInfo
}
if [catch {cli_exec $cli1(fd) "interface GigabitEthernet0/0/0/2"} result] {
error $result $errorInfo
}
if [catch {cli_exec $cli1(fd) "no shutdown"} result] {
error $result $errorInfo
}
if [catch {cli_exec $cli1(fd) "commit"} result] {
error $result $errorInfo
}
#close the cli connection
if [catch {cli_close $cli1(fd) $cli1(tty_id)} result] {
    error $result $errorInfo
}

but when I register it with event manager on a cisco ios-xr (6.4.1) I got the following error 

event manager policy newTest2.tcl username admin persist-time 3600 type user
!!% Embedded Event Manager configuration: failed to retrieve intermediate registration result for policy newTest2.tcl
end

Thank you in advance


 

0 Replies 0