Hello,
this is my first time trying to do eem script.
I want a script that will look the syslog for the message "track 2 state Track_Down" and if found, shut down an interface.
I created the file (based on what i have found from other users) but it seems that i am missing something.
Thank you !!!
Router global config:
event manager environment _syslog_pattern .*(track 2 state Track_Down)
event manager directory user policy disk0:
event manager policy test-link-down.tcl username eem persist-time 3600
I have also created user eem under admin config.
Below is the script config
::cisco::eem::event_register_syslog pattern {.*track 2 state Track_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) "enable"} _cli_result] {
error $_cli_result $errorInfo
}
if [catch {cli_exec $cli1(fd) "conf t"} _cli_result] {
error $_cli_result $errorInfo
}
if [catch {cli_exec $cli1(fd) "int Gi0/0/0/3.100"} _cli_result] {
error $_cli_result $errorInfo
}
if [catch {cli_exec $cli1(fd) "shut"} _cli_result] {
error $_cli_result $errorInfo
}
if [catch {cli_exec $cli1(fd) "commit"} _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