cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
8668
Views
5
Helpful
5
Comments
Jason Pfeifer
Cisco Employee
Cisco Employee

Posted By:

jclarke

Posted Date:

Aug 17, 2010

Category:

User Interface

Version:

1.1

License:

Cisco-Style BSD

Summary:

This script implements multiple pipe support from the IOS command line.

Script Modified Date:

Aug 17, 2010

Cisco IOS Version tested:

15.0(1)M 12.2(53)SE

Cisco Products Tested:

2821 3560

Environment Variables used:

Rating Count:

0

Average Rating:

0

File Size:

2.7 KB

Script Info URL:

How many times have you wanted to do "show run | inc snmp | redirect  flash:/snmp.cfg"? Up until now this wasn't possible because IOS only  supports one pipe. The other pipes are treated as part of the argument  to the first pipe command. The cl_multi_pipe.tcl EEM policy enables the  support for multiple command pipelines. You can run as many pipe  commands as you want.

Comments
wanmohdhafiz
Level 1
Level 1

hi..this is my problem...

I want to sent output command from switch to ftp server..Below are the step that i have done :

1- Copy script cl_multi_pipe.tcl to my switch (Cisco catalyst WS-C3560E-12SD , IOS : 12.2(55)SE)


C3560G#dir

Directory of flash:/

    2  -rwx        3096  Oct 28 2011 23:59:02 +08:00  multiple-fs

    3  -rwx        3857  Oct 28 2011 23:59:02 +08:00  private-config.text

    4  -rwx        5716  Oct 28 2011 23:59:01 +08:00  config.text

    5  -rwx        8916  Jul 25 2011 16:12:38 +08:00  vlan.dat

  443  -rwx        4524  Nov 18 2011 15:09:34 +08:00  cl_multi_pipe.tcl

    6  drwx         512  Nov 12 2010 15:31:05 +08:00  c3560e-universalk9-mz.122-55.SE

57931776 bytes total (39990272 bytes free)

2- Create event manager directory & policy


C3560G#sh ru | b event

event manager directory user policy "flash:/"

event manager policy cl_multi_pipe.tcl

!

end

3- At the same time i already configure kron & command to push text file to my ftp server

kron occurrence PipeOut at 15:00 sun recurring

policy-list PipeOut

!

kron policy-list PipeOut

cli show version | i uptime | redirect ftp://172.17.30.1/uptime.txt

4- Description for all above step.

- I start with configure step 3 to gather information about switch uptime

- Switch will kron text file every sunday at 15:00pm to ftp server

- This task cannot be done because kron cannot accept double pipe ( i guest ?)

- The idea is to use Cisco EEM features to do the double pipe command.

- My problem :: How to configure EEM so that the task will run automatically just like kron schedule ?

Please advice.

Thanks

Cory Anderson
Level 1
Level 1

Hi Joe,

I've used this script in the past on other equipment without an issue, but I'm having some difficulty now.  Any ideas of what the problem is?

881W-Router#dir flash: | i .tcl
    7  -rw-           0  Aug 24 2014 16:20:24 +00:00  cl_multi_pipe.tcl
 

881W-Router#show run | i event
event manager directory user policy "flash:/"

881W-Router(config)#event manager policy cl_multi_pipe.tcl
EEM Register event failed: Error unable to parse EEM policy for registration commands.

EEM configuration: failed to retrieve intermediate registration result for policy cl_multi_pipe.tcl

I'm interpreting this as having EEM version 4.00

881W-Router#show event manager version
Embedded Event Manager Version 4.00
Component Versions:
eem: (rel4)1.0.0
eem-gold: (rel1)1.0.2
eem-call-home: (rel2)1.0.0
Event Detectors:
Name                Version   Node        Type
application         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
ipsla               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
nf                  01.00     node0/0     RP
rpc                 01.00     node0/0     RP
 

 

Collin Clark
VIP Alumni
VIP Alumni

Cory-

Did you ever find a fix for this? I'm getting the same result.

I know this is an old thread, but i had the same issue and the solution was applying the following command:

event manager directory user policy "flash:/"

 

TCL worked flawlessly. Thank you.

kmart1287
Level 1
Level 1

Old thread, but has anyone figured out how to get this to work ? currently cant get it to work on 3850 , Event manger version 4.00

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: