IOS XR run multiple policies

Answered Question
Aug 27th, 2012

Hi,

on IOS 15.1 with eem version 3.2 the default setting for the number of parallel tcl policies that can run is one.

There is the command "event manager scheduler script thread class <name> number <#>"  to change the number of scripts that can be executed in parallel.

I could not find a similar command on IOS XR, does somebody know the default value there and maybe a command to change it? In addition there is also no "show event manager version" command, which version of eem is available on IOS XR? The IOS XR version I used is 4.1.2

Thanks for any advice

I have this problem too.
0 votes
Correct Answer by Joseph Clarke about 1 year 7 months ago

There is no equivalent in IOS-XR.  Last time I did a big IOS-XR project, I found that one policy would run at a time.  However, you could test that.  Register this script, then run it multiple times in parallel from different VTYs.

::cisco::eem::event_register_none

namespace import ::cisco::eem::*

namespace import ::cisco::lib::*

action_syslog msg "I'm here"

after 10000

action_syslog msg "After a good sleep, still here"

If they are running in parallel, you should see multiple "I'm here's" before you see the second message.

IOS-XR doesn't support a version of EEM equivalent to IOS.  However, if I had to give you a version, I would say, it's like EEM 2.1.

  • 1
  • 2
  • 3
  • 4
  • 5
Average Rating: 5 (2 ratings)
Correct Answer
Joseph Clarke Mon, 08/27/2012 - 09:49

There is no equivalent in IOS-XR.  Last time I did a big IOS-XR project, I found that one policy would run at a time.  However, you could test that.  Register this script, then run it multiple times in parallel from different VTYs.

::cisco::eem::event_register_none

namespace import ::cisco::eem::*

namespace import ::cisco::lib::*

action_syslog msg "I'm here"

after 10000

action_syslog msg "After a good sleep, still here"

If they are running in parallel, you should see multiple "I'm here's" before you see the second message.

IOS-XR doesn't support a version of EEM equivalent to IOS.  However, if I had to give you a version, I would say, it's like EEM 2.1.

widmermanuel1987 Thu, 08/30/2012 - 05:52

Thank you, Joseph, for the quick response.

I did some tests on our router and it runs only one policy at a time indeed. Do you know a hack to change this limit?

Is there any documentation about the tcl extensions in IOS_XR ? I already spent hours searching the cisco page and google but could only find documentation for IOS.

I'd be specifically interested in the "sys_reqinfo_snmp" command to read out snmp values from tcl. I already tried it, the command seems to be implemented but i never get any output from it, so it might be broken ? 

here some code:

::cisco::eem::event_register_none

namespace import ::cisco::eem::*

namespace import ::cisco::lib::*

# get the {value}-part of of an snmp request

# returns an empty string if nothing happened

proc snmp_getexact {oID} {

    # snmp query

    set snmpOutput [sys_reqinfo_snmp oid $oID get_type exact]

    # init result

    action_syslog priority debug msg "getexact: $snmpOutput"

    set val ""

    # parse output

    regexp {.*value {(.*)}} $snmpOutput ignore val

    return $val

}

# get number of configured interfaces

# ifNumber.0 = 1.3.6.1.2.1.2.1.0

set snmpResult [snmp_getexact "1.3.6.1.2.1.2.1.0"]

action_syslog priority debug msg "ifNumber: >>> $snmpResult <<<"

and the output:

tclsh[65867]: %HA_EM-7-LOG: bandwidth_XR.tcl: getexact: 

tclsh[65867]: %HA_EM-7-LOG: bandwidth_XR.tcl: ifNumber: >>>  <<<

widmermanuel1987 Mon, 10/01/2012 - 06:42

sys_reqinfo_snmp is officially supported since IOS-XR 4.2.0 (but it is not documented). Syntax is exactly as in the examples above.

Just in case anyone ends up in this thread looking for this.

Joseph Clarke Mon, 10/01/2012 - 08:22

Yes, XR 4.2 is the first release to start the sync with IOS EEM Tcl.  At the time, I didn't see that XR 4.2 was out for the ASR.  Looks like 4.2.3 is available now.

Actions

Login or Register to take actions

This Discussion

Posted August 27, 2012 at 4:31 AM
Stats:
Replies:5 Avg. Rating:5
Views:1128 Votes:0
Shares:0
Tags: script, eem, ios-xr
+
Categories: EEM for IOS-XR
+

Related Content

Discussions Leaderboard