11-30-2018 01:09 AM
I wrote an EEM script to start a telnet session
event manager applet getip
event none maxrun 20
action 10 cli command "enable"
action 20 cli command "telnet someserver 54321" pattern "Open"
action 30 cli command "show internal ip" pattern "prompt"
action 50 regexp "([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)" "$_cli_result" ip
action 60 puts "$ip"
However, the telnet session is not closed by remote. As a result, my script cannot apply additional config. Is there a way to close the current EEM triggered telnet session? e.g. injecting the escape sequence using "cli command"?
11-30-2018 01:19 AM
Hi, can you test another service like this:
telnet telnetmyip.com
When you get the IP, the remote server close the connection.
Regards.
11-30-2018 11:29 AM
11-30-2018 04:17 AM
hi, this thread should be helpful
https://community.cisco.com/t5/network-management/eem-script-to-open-a-telnet-session/m-p/2327773
regards, mk
11-30-2018 08:36 AM
I have seen that thread but I don't want to use Tcl script. Specifically there is difficulty adding a file as oppose to a simple config change. I feel that I am very close. I can think of triggering another EEM script to continue with the result but I would much prefer doing it in a single EEM script to keep it simple.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide