Re: EEM Applet - Restarts Router

From: Rares Donca <rares.donca_at_gmail.com>
Date: Wed, 2 Mar 2011 08:50:55 +0200

Hello,

Yes, the correct increment is: "action 7.0 increment i", then the applet is
working fine.

Stiil, there is not an endless loop, because the $_cli_result has a finite
number
of lines. Or am I missing something? I think that the crash is because I
increment a variable, "counter", who does not exists.

Regards,
Rares

On Wed, Mar 2, 2011 at 8:43 AM, Maarten Vervoorn <mr.vervoorn_at_gmail.com>wrote:

> Your increment command is wrong
> you need to configure
> action 7.0 counter i 1
>
> Your router is ending up in a endless loop
>
> Kind regards,
>
> Maarten Vervoorn
>
> 2011/3/1 Rares Donca <rares.donca_at_gmail.com>
>
>> Hello all,
>>
>>
>> It seems that Cisco IOS does not do very much to protect memory.
>>
>> I have the following applet:
>>
>> event manager applet PROC
>> event none
>> action 1.0 cli command "enable"
>> action 2.0 cli command "show processes cpu sorted 5min"
>> action 3.0 set i 0
>> action 4.0 set output ""
>> action 5.0 foreach line "$_cli_result" "\n"
>> action 6.0 append output "$line"
>> action 7.0 increment counter
>> action 8.0 if $i eq 9
>> action 9.0 break
>> action 9.1 end
>> action 9.2 end
>> action 9.3 puts $output
>>
>> This will output only first 9 lines from show processes cpu sorted.
>> Well, actually there is a typo( and I lost some time until i saw that),
>> but for that "increment counter" the router is restarting.
>>
>> I tested this on all my lab routers, 2811 with the following IOS,
>> (C2800NM-ADVENTERPRISEK9-M), Version 12.4(24)T4, and all routers
>> are restarting.
>>
>> Has anyone seen something like this before?
>>
>> Definitely not something to try in the lab :).
>>
>> Regards,
>> Rares
>>
>>
>> Blogs and organic groups at http://www.ccie.net
>>
>> _______________________________________________________________________
>> Subscription information may be found at:
>> http://www.groupstudy.com/list/CCIELab.html

Blogs and organic groups at http://www.ccie.net
Received on Wed Mar 02 2011 - 08:50:55 ART

This archive was generated by hypermail 2.2.0 : Fri Apr 01 2011 - 06:35:41 ART