11-07-2022 08:31 AM
I am trying to create an output file and save it to flash. Here is what I want:
show log | i DECTK
But I want to redirect the results to a text file in flash. I realize I can use the redirect command, but I can only do that with the entire log. I only want specific log that I created using EEM. I also can't use the include and redirect command at the same time. Is there a way I can accomplish this?
Solved! Go to Solution.
11-09-2022 05:32 AM
HOSTNAME#show event manager version
Embedded Event Manager Version 4.00
Component Version:
eem: (rel9)1.3.0
eem-gold: (rel1)1.0.2
eem-call-home: (rel2)1.0.5
Event Detectors:
Name Version Node Type
application 01.00 node0/0 RP
rf 01.00 node0/0 RP
identity 01.00 node0/0 RP
neighbor-discovery 01.00 node0/0 RP
routing 02.00 node0/0 RP
syslog 01.00 node0/0 RP
generic 01.00 node0/0 RP
nhrp 01.00 node0/0 RP
track 01.00 node0/0 RP
resource 01.00 node0/0 RP
cli 01.00 node0/0 RP
counter 01.00 node0/0 RP
interface 01.00 node0/0 RP
ioswdsysmon 01.00 node0/0 RP
none 01.00 node0/0 RP
oir 01.00 node0/0 RP
snmp 01.00 node0/0 RP
snmp-object 01.00 node0/0 RP
snmp-notification 01.00 node0/0 RP
timer 01.00 node0/0 RP
test 01.00 node0/0 RP
config 01.00 node0/0 RP
env 01.00 node0/0 RP
ds 01.00 node0/0 RP
crash 01.00 node0/0 RP
nf 01.00 node0/0 RP
rpc 01.00 node0/0 RP
ipsla 01.00 node0/0 RP
12-02-2022 07:10 AM
I figured out my issue. In order to use the variable correctly, I needed to put either single quotes around the variable, or a back slash in front of it.
event manager applet 999_A trap authorization bypass
event track 999 state up
action 1.0 cli command "enable"
action 1.1 syslog priority warnings msg ",DECTK Kit,DG4_ECK_03,is online."
action 1.2 file open fh flash:report.txt a+
action 1.3 file write fh "\$_event_pub_time,DECTK Kit,DG4_ECK_03,is online."
action 1.4 file close fh
event manager applet 999_B trap authorization bypass
event track 999 state down
action 1.0 cli command "enable"
action 1.1 syslog priority warnings msg ",DECTK Kit,DG4_ECK_03,is offline."
action 1.2 file open fh flash:report.txt a+
action 1.3 file write fh "\$_event_pub_time,DECTK Kit,DG4_ECK_03,is offline."
action 1.4 file close fh
My final script. It works just as I want it to. Thanks for your guidance.
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