EEM variable for show command output and create a filename
I'm configuring EEM applet, example CPU High event. When it triggers the event, action is "show tech | redirect tftp://x.x.x.x/showtechoutput". The EEM event is working fine and triggered the show tech output into the tftp server. My question is, i'd like to add maybe date/time in the filename so it will not overwrite the file everytime there is a triggered event.
The EEM event variable i'm seeing in doc is "_event_pub_sec" but it won't work when i add after or before the filename. any idea?
That said, TFTP is very particular about how files can be created. Typically, a TFTP server will require the file to exist before a remote host can copy to it. If the filename changes each second, this will not work. Using a protocol like FTP or SCP may work better.
I did not include all actions for short post, we have "enable" command as first action. In action 70 , $filename or $_filename does not create file with that name. However regex seems working, below commands worked as expected:
event manager applet test event none action 10 cli command "en" action 20 cli command "sh clock" action 21 regexp "([0-9]+).*" "$_cli_result" match hour action 22 regexp ".*\[0-9]+):.*" "$_cli_result" match minute action 23 regexp ".*\.([0-9]+).*" "$_cli_result" match msec action 25 set result "TEST-IPT-GT-$hour$minute$msec" action 30 set filename "$result.txt" action 40 cli command "sh clock | append flash:$filename" action 90 cli command "exit"
We are pleased to announce availability of Beta software for 16.6.3. 16.6.3 will be the second rebuild on the 16.6 release train targeted towards Catalyst 9500/9400/9300/3850/3650 switching platforms. We are looking for early feedback from custome...