Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Community Member

Embedded syslog manager and TCL scripting

Hi,

I'm a newbie to TCL scripting and I'm doing some tests with ESM and TCL scripts

The final idea is  to implement a script that will send an email when an EIGRP neighbor changes takes place. For the moment I'm just beginning and I already have an issue

I tried to implement the following:

if { [string length $::orig_msg] < 5 } { puts "test2" } else { puts "bigger then  0" }

As soon as I come out of configuration mode it should put the text " bigger then 0."

When I just implement

if { [string length $::orig_msg] > 5 } { puts "test2" }

I get the output "test2"

As soon as I add the else statement  it doesn't do anything anymore. I suspect that there is a syntax error  but I can't find it

Can anybody help me ?

gr

wim

1 REPLY
Cisco Employee

Re: Embedded syslog manager and TCL scripting

There is no Tcl syntax error per se, but using puts with ESM can be unpredictable.  Try using return instead to return a new syslog message:

if { [string length $::orig_msg] < 5 } {

     return "test2"

} else {

     return "bigger than 0"

}

325
Views
0
Helpful
1
Replies
CreatePlease to create content