cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1204
Views
0
Helpful
2
Replies

eem script with pipe

paul amaral
Level 4
Level 4

Hoping someone can help me here as i been unable to figure this out.

I have a command "sh ip cache flow | in 0000" that I need to append to a file on flash.

However when i use action 1.6 cli command "sh ip cache flow | in 0000 | append disk0:/rxload.txt" it does not work because of the extra pipe. I was thinking of using $_cli_result but cant figure out how to append that to the file.

 

TIA, Paul 

 

 

2 Replies 2

Seb Rupik
VIP Alumni
VIP Alumni

Hi there,

I have only tested this on GNS3 (where it is not working)...but try the following:

 

!
event manager applet TEST
 event none
 action 1.0 cli command "sh ip int | inc packets"
 action 1.5 file open fh disk0:/test.txt w
 action 1.6 file write fh "$_cli_result"
 action 1.7 file close fh
!

...reading the EEM4.0 docs, there is no mention of whether action file write appends to an existing file or not....hopefully it does.

 

cheers,

Seb.

that did not work, anyone know how to pass a | in a EEM script. 

 

Paul 

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: