You can use the ASCII code for the "sub" character to trigger a Control+Z. That code is \032. If you have your policy interacting with the "send" prompt already, then send \032 to cause the Control+Z. You may run into issues doing this with an applet as Control+Z will be interpreted by the config. It's much easier to do this via Tcl.
Thank you for the suggestion! I'd like to try this and see where I get. Do you know of an example config that uses this within an EEM, or is it something that is typically done via TCL? I'm really trying to find a way to send custom information to the VTY lines. That's the only way I can think of, to inform a user that an EEM has failed to complete.
Another thought, would be to have the EEM run the action "terminal monitor" before executing, and then running the terminal no monitor when it's finished. That would theoretically display the failed EEM output. At the same time, however, it would display any input currently logging to the console. =/
If you're curious, this is my EEM in question.
The goal is to have it inform the user in the event of a failure. (I currently have it doing this via e-mail):
event manager applet backup_config_on_save event cli pattern "write" sync no skip no action 0.01 info type routername action 1.00 cli command "enable" action 1.01 cli command "ping $tftp_server" action 1.02 regexp "is (0) percent" "$_cli_result" match ping_result action 1.03 if $_regexp_result eq "0" action 1.04 cli command "configure terminal" action 1.05 cli command "file prompt quiet" action 1.06 cli command "end" action 1.07 cli command "copy running-config tftp://$tftp_server/$_info_routername" action 1.08 cli command "configure terminal" action 1.09 cli command "no file prompt quiet" action 2.00 else action 2.01 mail server "$_email_server" to "$_email_to" from "$_email_from" subject "EEM: Unable to save $_info_routername config." body "Unable to ping TFTP server: $tftp_server from device: $_info_routername.\nPlease review." action 2.02 end
What you have here is very dangerous. You should consider changing your pattern to "^write" at the very least. But even so, this would match write net, write term, and wouldn't catch "copy runn start".
In terms of sending a ^Z in an applet, I don't have an example I can think of. Though this is familiar, so maybe if you search around you might find one. Within EEM Tcl, this is trivial. One can simply add \032 in a cli_write call to cause the ^Z. In an applet, you might have to do something like:
This is actually a pretty cool feature, i didn't even know it existed until I was looking for a solution to advertise a subnet (prefix in BGP talk), only if a certain condition existed. This is exactly what conditional advertisements does
j ai une question j ai achete un routeur cisco 887VA-k9 , je le configuré avec la configuration ci- dessous
si je le lier avec mon pc portable sur l un de ses ports directement ça marche toute est bien ( la connexion internet + m...
Attached policy provides CLI access to the Cisco 4G router over text messaging. Two files are in the attached .tar file:
2. PDF with instructions on how to load and use the .tcl file.