But here the issue with the EEM program is that ,this will work only with IOS 12.4 ( 24 ) , but for CCIE Lab the IOS version is 12.4(15) which will not support the set and foreach command ,and it is restricted to use the pattern and regular expression , is there is any way other than this ?
On Tue, Nov 30, 2010 at 8:06 PM, Tyson Scott <[email protected]> wrote: > Looks pretty good to me. EEM and TCLsh are so powerful that there are many > ways to do things, I will be the first to admit I don't know all of them. > > > > Regards, > > > > Tyson Scott - CCIE #13513 R&S, Security, and SP > > Managing Partner / Sr. Instructor - IPexpert, Inc. > > Mailto: [email protected] > > Telephone: +1.810.326.1444, ext. 208 > > Live Assistance, Please visit: www.ipexpert.com/chat > > eFax: +1.810.454.0130 > > > > IPexpert is a premier provider of Self-Study Workbooks, Video on Demand, > Audio Tools, Online Hardware Rental and Classroom Training for the Cisco > CCIE (R&S, Voice, Security & Service Provider) certification(s) with > training locations throughout the United States, Europe, South Asia and > Australia. Be sure to visit our online communities at > www.ipexpert.com/communities and our public website at www.ipexpert.com > > > > *From:* Abdel el Anazi [mailto:[email protected]] > *Sent:* Tuesday, November 30, 2010 5:43 AM > *To:* Tyson Scott > *Cc:* 'ravi namboodiri'; [email protected] > *Subject:* Re: [OSL | CCIE_RS] EEM applet > > > > what about this: > > action 01 cli command "enable" > action 02 cli command "show process cpu sorted" > action 03 set line 0 > action 04 foreach line "$_cli_result" "\n" > action 05 if $line gt 11 > action 06 break > action 07 end > action 08 append output $line > action 09 increment lines > action 10 end > > > > > > > On 11/30/2010 8:47 AM, Tyson Scott wrote: > > Well since you weren't very specific on which command I will show two > > different examples. > > > > ISP's#show proc cpu | incl ^ [1-5] > > 1 8 75 106 0.00% 0.00% 0.00% 0 Chunk > > Manager > > 2 12 9646 1 0.07% 0.02% 0.00% 0 Load Meter > > > > 3 0 1 0 0.00% 0.00% 0.00% 0 chkpt > > message ha > > 4 0 1 0 0.00% 0.00% 0.00% 0 EDDRI_MAIN > > > > 5 33856 5732 5906 0.00% 0.09% 0.06% 0 Check heaps > > > > ISP's# > > > > ISP's#show running-config linenum | incl ^ [1-5] > > 1 : ! > > 2 : version 12.4 > > 3 : service timestamps debug datetime msec > > 4 : service timestamps log datetime msec > > 5 : no service password-encryption > > ISP's# > > > > Is there a reason something like these two cannot be used? Are you saying > > the command you use cannot include a regular expression or the EEM applet. > > If so you can use the TCL to read line by line from an exec command, but > > that is a little more difficult. I would have to get back to you on that as > > I am not sure right now, with expect it would be something like this, > > > > send "show proc cpu | incl \%\r" > > expect "show proc cpu | incl" > > set count 0 > > log_user 1 > > while { $count < 4 } { > > expect { > > -re "\n.*\r" { incr count; continue } > > "\r\n.*#" > > } > > } > > log_user 0 > > > > I would have to play with TCL for a bit as the expect command isn't > > available with TCL but it should be something similar to the above output. > > > > > > set count 0 > > while { $count < 4 } { > > foreach > > print $line > > > > Regards, > > > > Tyson Scott - CCIE #13513 R&S, Security, and SP > > Managing Partner / Sr. Instructor - IPexpert, Inc. > > Mailto: [email protected] > > Telephone: +1.810.326.1444, ext. 208 > > Live Assistance, Please visit: www.ipexpert.com/chat > > eFax: +1.810.454.0130 > > > > IPexpert is a premier provider of Self-Study Workbooks, Video on Demand, > > Audio Tools, Online Hardware Rental and Classroom Training for the Cisco > > CCIE (R&S, Voice, Security & Service Provider) certification(s) with > > training locations throughout the United States, Europe, South Asia and > > Australia. Be sure to visit our online communities at > > www.ipexpert.com/communities and our public website at www.ipexpert.com > > > > > > -----Original Message----- > > From: [email protected] > > [mailto:[email protected] > <[email protected]>] On Behalf Of ravi namboodiri > > Sent: Tuesday, November 30, 2010 1:22 AM > > To: [email protected] > > Subject: [OSL | CCIE_RS] EEM applet > > > > hi, > > Is there any way to get 5 lines of a command output without with embedded > > event manager 2 without using regular expressiion and pattern amtching. > > > > I tried the same with scripting but it is not supported in EEM 2.0. > > > > Is there any way by using any of the enviornment variable? > > > > regards, > > > > Ravi > > > > > > _______________________________________________ > > For more information regarding industry leading CCIE Lab training, please > > visit www.ipexpert.com > > > > _______________________________________________ > > For more information regarding industry leading CCIE Lab training, please > visit www.ipexpert.com > > > > _______________________________________________ > For more information regarding industry leading CCIE Lab training, please > visit www.ipexpert.com > > -- Navas Chenganath Network Analyst Parsons International Limited, P.O. BOX 9123, Dubai. Phone : +971-4-402-9707 Mob : +971-50-432-8819 Mob : +971-50 8344622 EMail : [email protected] [email protected]
_______________________________________________ For more information regarding industry leading CCIE Lab training, please visit www.ipexpert.com
