cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3148
Views
0
Helpful
25
Replies

Tcl Script Not Executing

Hello Community,

I have been working very hard to get the attached script to work. It was working and for some reason it has stopped working.

It has registered successfully, however I keep on getting the following error message when it's due to activate.

Process Forced Exit- MAXRUN timer expired.

    while executing

"if [catch {cli_exec $cli(fd) "show interface [ lindex $interface $i ]"} result] {

    error $result $errorInfo

}"

    invoked from within

"$slave eval $Contents"

    (procedure "eval_script" line 7)

    invoked from within

"eval_script slave $scriptname"

    invoked from within

"if {$security_level == 1} {       #untrusted script

     interp create -safe slave

     interp share {} stdin slave

     interp share {} stdout slave

..."

    (file "tmpsys:/lib/tcl/base.tcl" line 50)

Tcl policy execute failed:

Process Forced Exit- MAXRUN timer expired.

1Process Forced Exit- MAXRUN timer expired.

    while executing

"if [catch {cli_read_drain $cli(fd)} result] {

    error $result $errorInfo

}"

I wonder if someone could take a look and provide some assistance? Really appreciate it.


Cheers

Carlton

1 Accepted Solution

Accepted Solutions

Yes, that's the point of adding the "down" bit to the regular expression.  Interfaces that are not up are excluded since you wouldn't typically care about those.

View solution in original post

25 Replies 25

Hi Joseph,

If you're going to assist me, you may recall telling me to add the following line if the interfaces are to be switchports:

if [catch {cli_exec $cli(fd) "sh ip int brief | exc Interface|down|\[0-9\]*/\[0-9\]*\\.\[0-9\]*

That did work but is now not working.

Joe Clarke
Cisco Employee
Cisco Employee

Try doubling the maxrun time to 120 and re-registering the policy.  If you have a lot of interfaces, this can take a long time.

Hi Joseph,

There is indeed a whole lot of interfaces. Appreciate you coming back to me.

I will try your suggestion.

Cheers

Hi Joseph,

Can you let me know where I would configure the maxrun timer?

Cheers

Joseph,

Would I simply need to add the following line at the begining of the script?

#::cisco::eem::event_register_timer cron name test cron_entry "0 * * * *" queue_priority low nice 1 maxrun 120

Joseph,

I'm being dork!

I see it. Going to increase it and see if it makes a difference.

cheers

Hi Joseph,

I made the changes. Unfortunately, now the script doesn't work at all.

The following are my variables:

event manager environment input_errors_threshold 1000

event manager environment output_errors_threshold 1000

event manager environment crc_threshold 1000

event manager environment interface_reset_threshold 5

event manager environment interface_health_period 10

event manager environment _email_server x.x.x.x

event manager environment _email_from carlton.patterson@email.co.uk

event manager environment _email_to carlton.patterson@email.co.uk

event manager directory user policy "flash:/Syslog"

event manager session cli username "en.bcz00513"

As you can see I've set the period to 10seconds, and the interface resets to 5

The followig is my interface:

GigabitEthernet1/0/10 is down, line protocol is down (notconnect)

  Hardware is Gigabit Ethernet, address is b0fa.ebc3.128a (bia b0fa.ebc3.128a)

  Description: Desktop PC Floor Second South

  MTU 1500 bytes, BW 1000000 Kbit, DLY 10 usec,

     reliability 255/255, txload 1/255, rxload 1/255

  Encapsulation ARPA, loopback not set

  Keepalive set (10 sec)

  Auto-duplex, Auto-speed, media type is 10/100/1000BaseTX

  input flow-control is off, output flow-control is unsupported

  ARP type: ARPA, ARP Timeout 04:00:00

  Last input never, output 4d00h, output hang never

  Last clearing of "show interface" counters 1d07h

  Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0

  Queueing strategy: fifo

  Output queue: 0/40 (size/max)

  5 minute input rate 0 bits/sec, 0 packets/sec

  5 minute output rate 0 bits/sec, 0 packets/sec

     0 packets input, 0 bytes, 0 no buffer

     Received 0 broadcasts (0 multicasts)

     0 runts, 0 giants, 0 throttles

     0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored

     0 watchdog, 0 multicast, 0 pause input

     0 input packets with dribble condition detected

     0 packets output, 0 bytes, 0 underruns

     0 output errors, 0 collisions, 6 interface resets

     0 babbles, 0 late collision, 0 deferred

     0 lost carrier, 0 no carrier, 0 PAUSE output

As you can see the reset is 6. However, the script doesn't recognise it.

Also see below for registration:

2    script    user    timer watchdog      Off   Sun Jul 28 17:36:17 2013  2048  composite_device_health.tcl

name {composite_device_health_interfac} time 10.000

nice 1 queue-priority low maxrun 120.000 scheduler rp_primary

Any thoughts would greatly appreciated.

Cheers

Joesph,

I'm actually getting the same error as before:

Jul 28 18:14:46.191: %HA_EM-7-FMS_POLICY_MAX_ENTRIES: fh_schedule_policy: Class default: Maximum number of 64 script publish entries exceeded; some events have been discarded

However, I don't have any other scripts running.....

Sorry, I meant to say I only have one other script running

It doesn't matter how many you have.  It only matters how many times a policy is being invoked versus how fast it can complete.  Given the maxrun timer, you must make sure your watchdog timer frequency is at least 120 seconds.

Hi Joseph,

Thanks again for getting back to me. I think I changed the watchdog timer correctly, see below, however the script still won't activate:

2    script    user    timer watchdog      Off   Sun Jul 28 22:14:51 2013  2048  composite_device_health.tcl

name {composite_device_health_interfac} time 120.000

nice 1 queue-priority low maxrun 120.000 scheduler rp_primary

What does that mean?  Do you see it executing in "show event manager history events"?

Hi Joseph,

Sorry if my message seemed a little cryptic.

My last post was just to show that I changed the watchdog and maxrun timer to 120.

First thing, can you let me know if timer number refer to seconds or minutes?

The reason I ask is because when I made the change last night I was hoping that I script would activate in 120 seconds. So when the script didn't execute I assumed the script wasn't working. However, after 7 hours the script activated.

I don't understand why.

Any thoughts?

Cheers

The time and maxrun are specified in seconds.  Once registered, the policy will run after 120 seconds (the way you configured it).  You can confirm if it did or not in "show event manager history events".

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: