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]] 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