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

TCL Script to track object and change PIM DR Priority

marcosdiaz
Level 1
Level 1

Hello everyone

 

Recently i got into a problem where i need to change the PIM DR priority of an interface when some other interface on the router goes down.

 

I heard before about TCL but never used it before, if you have any guides or leads that i could follow to achieve my goal i would thank you so much.

 

Regards

2 Replies 2

marcosdiaz
Level 1
Level 1

so far i have the following, i can register the policy, i can see that it runs when the track 1 state goes down, but it does not change the config at all

 

::cisco::eem::event_register_track 1 state down

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

array set arr_einfo [event_reqinfo]


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

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

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

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

if [catch {cli_exec $cli1(fd) "no dr-priority"} _cli_result] {
    error $_cli_result $errorInfo
}

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


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

Nevermind guys, i answered myself, i had problems with the authorization of the commands, i had to create a vty-pool eem and assign the proper aaa list to the line template and now its all working.

Regards.