cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2873
Views
5
Helpful
5
Replies

IOS XR run multiple policies

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

1 Accepted Solution

Accepted Solutions

Joe Clarke
Cisco Employee
Cisco Employee

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.

View solution in original post

5 Replies 5

Joe Clarke
Cisco Employee
Cisco Employee

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.

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

The sys_reqinfo_snmp command is not implemented on IOS-XR in your version.  See

http://www.cisco.com/en/US/docs/routers/asr9000/software/asr9k_r4.1/system_monitoring/configuration/guide/b_sysmon_cg41asr9k_chapter_010.html for the commands that do exist.

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.

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.

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: