02-17-2021 05:53 AM
Hi
I built an EEM menu into my routers to expedite results. Currently -below- is my IPSec MENU. This EEM script is 4+ pages long and thus would like to modularize the menu into separate modules for ease of updates and any EEM troubleshooting.
In my attempt to modularize the menu, I created one applet named MENU and 7 sub-applets (choices 1-7) that will be called from the MENU applet using the "action # publish-event sub-system" option. The sub-applets use the "event application sub-menu" option. From the MENU, I choose option 1 which calls module 1. This does work except now all of the show command output that use to show in the terminal windows is now only showing in the router log.
1 - Show ISAKMP IKEv2 session status
2 - Show IPSec IKEv2 session status
3 - Show all configured IKEv1/IKEv2 peers
4 - Show all Crypto IKEv1 sessions
5 - Clear Crypto sessions using IKEv2
6 - Clear all Crypto IKEv1 & IKEv2 sessions
7 - Capture packets and automatically tftp
My questions:
How can I get the show command output data to return to the terminal window?
Is there a better way to modularize this script using EEM and without resorting to another language?
Platform: CSR1000v IOS-XE 16.10 Gibraltar running in ESXi VMware 6.5 and VMware Workstation Pro 14
Thank you
Frank
02-17-2021 09:14 AM
To help better understand what is happening I have posted the results of BEFORE and AFTER.
EEM Menu BEFORE modularization
alias cc calls the EEM applet menu.
R1#cc
______________EEM Crypto Status Ver 6___________________
Choices:
1 - Show ISAKMP IKEv2 session status
2 - Show IPSec IKEv2 session status
3 - Show all configured IKEv1/IKEv2 peers
4 - Show all Crypto IKEv1 sessions
5 - Clear Crypto sessions using IKEv2
6 - Clear all Crypto IKEv1 & IKEv2 sessions
7 - Capture packets on R1, automatically tftp to 192.168.1.55
____________Type cc to reload this menu__________________
Choice 1
- - - - - - - - - - - - - - - - - - - - - - - -
show crypto ikev2 sa results
ISAKMP IKEv2 between R1 <----> R3 is "D O W N"
- - - - - - - - - - - - - - - - - - - - - - - -
ISAKMP IKEv2 between R1 <----> R2 is "D O W N"
- - - - - - - - - - - - - - - - - - - - - - - -
EEM Menu AFTER modularization
R1#cc
______________EEM Crypto Status Ver 6___________________
Choices:
1 - Show ISAKMP IKEv2 session status
2 - Show IPSec IKEv2 session status
3 - Show all configured IKEv1/IKEv2 peers
-snip--
____________Type cc to reload this menu__________________
Choice 1
R1#
*Feb 17 15:22:21.171: %HA_EM-6-LOG: MENU-OPTION-1: - - - - - - - - - - - - - - - - - - - - - - - -
*Feb 17 15:22:21.292: %HA_EM-6-LOG: MENU-OPTION-1:
*Feb 17 15:22:21.292: %HA_EM-6-LOG: MENU-OPTION-1: show crypto ikev2 sa results
*Feb 17 15:22:21.292: %HA_EM-6-LOG: MENU-OPTION-1:
*Feb 17 15:22:21.292: %HA_EM-6-LOG: MENU-OPTION-1: ISAKMP IKEv2 between R1 <----> R3 is "D O W N"
*Feb 17 15:22:21.292: %HA_EM-6-LOG: MENU-OPTION-1:
*Feb 17 15:22:21.292: %HA_EM-6-LOG: MENU-OPTION-1: - - - - - - - - - - - - - - - - - - - - - - - -
*Feb 17 15:22:21.412: %HA_EM-6-LOG: MENU-OPTION-1:
*Feb 17 15:22:21.412: %HA_EM-6-LOG: MENU-OPTION-1:
*Feb 17 15:22:21.412: %HA_EM-6-LOG: MENU-OPTION-1: ISAKMP IKEv2 between R1 <----> R2 is "D O W N"
*Feb 17 15:22:21.412: %HA_EM-6-LOG: MENU-OPTION-1: - - - - - - - - - - - - - - - - - - - - - - - -
Would like to remove the excess logging stuff.
Thank you
Frank
02-18-2021 02:42 PM
Ok I figured out how to remove some of the excess noise by including no service timestamps debug at the beginning of the script. Then after each module script runs, reenable.
The last portion that would be VERY helpful if it disappeared appears to be an EEM related log message stamp.
%HA_EM-6-LOG:
anyone
ANYONE
ANYONE AT ALL
Btw, if anyone is interested in this EEM script, leave a note and once fixed, I’ll publish complete with comments. This could be a great EEM learning tool too.
tks
Frank
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