9

I'm attempting to set up client / server sockets in Cisco EEM 3.0 TCL with IOS version 12.4(24)T8 (this was recently upgraded to determine whether the problem was EEM ver).

I have the following two example Tcl scripts (ref: http://wiki.tcl.tk/15315 )

Server.tcl:

::cisco::eem::event_register_none maxrun 120

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

proc accept {chan addr port} {
    puts "$addr:$port says [gets $chan]"
    puts $chan goodbye
    close $chan
}
socket -server accept 12345
vwait forever

Client.tcl:

::cisco::eem::event_register_none maxrun 20

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

set chan [socket 10.0.0.2 12345]
puts $chan hello
flush $chan
puts "10.0.0.2:12345 says [gets $chan]"
close $chan

10.0.0.2 is assigned to a loopback.

When I show the listening ports via the "show control-plane host open-ports" command, the server port of 12345 is listening, but the client script does not produce any output. A telnet to the router (via a physical interface) to port 12345 results in a connection refused. No ACLs are enabled.

These scripts work from a Windows XP computer running ActiveTCL 8.5.

Is this a bug or security feature within EEM 3.0? Are any additional commands or settings required to enable TCP sockets within EEM 3.0?

  • Did any answer help you? if so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you could provide and accept your own answer. – Ron Maupin Aug 8 '17 at 9:16
3

I would start with debugging commands. I'd start with

debug event manager tcl cli

There's more information in the EEM best practices document over at https://supportforums.cisco.com/docs/DOC-12757 about debugging and troubleshooting.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.