EEM TCL for interface commands

I am working on a script that will make interface changes.  I am trying to do the following:
1) save the output from the following command:  #show cdp nei detail | i Interface
2) this will most likely give a list of interfaces some of which will be repeated.  If the interface is listed more than once then i would like to remove the
    repeated interface.  (note i am not concerned about the outgoing interface)
3)using the above information i would then like to make configuration to the interfaces with the following commands
     #config t
     #interface $intf
     #no mls qos vlan-based
     #mls qos trust dscp
i have started this script (please see attached file) and would really appreciate some assistance especially with how to eliminate multiple instances of the same interface.
thanks!!

I am having issues running scripts on my 3750x.  One of the few commands i am getting to work is the
router(tcl)#puts "testing this command"
most all other commands are not working for example:  ios_config, set
I am attaching a file with more details.  Any help would be greatly appreciated!

Similar Messages

  • EEM variable for show command output and create a filename

    I'm configuring EEM applet, example CPU High event. When it triggers the event, action is "show tech | redirect tftp://x.x.x.x/showtechoutput". The EEM event is working fine and triggered the show tech output into the tftp server. My question is, i'd like to add maybe date/time in the filename so it will not overwrite the file everytime there is a triggered event.
    The EEM event variable i'm seeing in doc is "_event_pub_sec" but it won't work when i add after or before the filename. any idea?
    thanks in advance ...

    Adding $_event_pub_sec to the end of the filename should work:
    action 1.0 "show tech | redirect tftp://x.x.x.x/showtech.$_event_pub_sec"
    That said, TFTP is very particular about how files can be created.  Typically, a TFTP server will require the file to exist before a remote host can copy to it.  If the filename changes each second, this will not work.  Using a protocol like FTP or SCP may work better.

  • EEM-TCL Script to switch config from interface X to interface Y

    Hello Guys,
    I’m trying to create a script which is controlled by an EEM-UPDOWN event of an interface. What I’m trying to do is, if interface X is down for some reason it should copy the interface configuration to interface Y.
    So my problem is I’m very new to eem-tcl scripting and I have some basic problem hopefully u can help me =) I’m working on a ASR9K !
    So what i have done so fare:
    ::cisco::eem::event_register_syslog occurs 1 pattern ".*CHANGED.*$_sat_1_link_1.*" maxrun 90   
    namespace import ::cisco::eem::*
    namespace import ::cisco::lib::*
    array set arr_einfo [event_reqinfo]
    if {$_cerrno != 0} {
        set result [format "component=%s; subsys err=%s; posix err=%s;\n%s" \
          $_cerr_sub_num $_cerr_sub_err $_cerr_posix_err $_cerr_str]
        error $result
    if [catch {cli_open} result] {
        error $result $errorInfo
    } else {
        array set cli1 $result
    action_syslog priority emergencies msg "start script testv1_1"
    #puts "\nEXECUTE CLI COMAND :\n"
    set out {cli_exec $cli1(fd) "show running-config formal interface $_sat_1_link_1"}
    set xout [split $out \n]
    #puts "DEBUG : $xout \n\n"
    set anz [llength $xout]
    #puts "DEBUG : count rows = $anz \n\n"
    for {set ii "0"}  {$ii < $anz } {incr ii} {
           set indexout [lindex $out $ii]
        regexp  {([\w]+)[ ]([\w\d/]+)\s(.*)} $indexout a b c d
        #puts "\nDEBUG START"
        #puts "\nindex Nr  $ii"
        #puts "Full Match: $a"
        #puts "Sub Match1: $b"
        #puts "Sub Match2: $c"
        #puts "Sub Match3: $d"
        #puts "DEBUG END\n"
        set intsrc {cli_exec $cli1(fd) "no $b $_sat_1_link_1 $d"}
        set intdest {cli_exec $cli1(fd) "$b $_sat_1_link_2 $d"}
    if [catch {cli_exec $cli1(fd) "commit"} result] {
        error $result $errorInfo
    if [catch {cli_exec $cli1(fd) "end"} result] {
        error $result $errorInfo
    action_syslog priority emergencies msg "End script testv1_1"
    ps. $_sat_1_link_1 and $_sat_1_link_2 are globaly set per cli in the event manager env.
    Thanks for your help and hopefully u can help me with this script

    Hey
    after show running-config formal interface TenGigE 0/0/2/1 the cli output example is :
    interface TenGigE0/0/2/1 description Test: 0-43
    interface TenGigE0/0/2/1
    interface TenGigE0/0/2/1 shutdown
    and now i want to split the config with my regex
    regexp  {([\w]+)[ ]([\w\d/]+)\s(.*)} $indexout a b c d
    As example line 1
    set x= "TenGigE0/0/2/2"                  --> =dest_interface
    a= interface TenGigE0/0/2/1 description Test: 0-43
    b= interface
    c= TenGigE0/0/2/1
    d= description Test: 0-43
    do this
    cli_exec $cli1(fd) "no $b $c $d"      --->no interface TenGig E0/0/2/1 description Test: 0-43
    cli_exec $cli1(fd) " $b $x $d"          ---> interface TenGigE0/0/2/2 description Test: 0-43
    and from this point it shoud do this until there are no config lines  =)
    as a final result is should copy the whole config from interface X to interface Y  if the trigger is active
    but as i see, the main problem is to get the CLI output in a format like this
    set xy = interface TenGigE0/0/2/1 description Test: 0-43\ninterface TenGigE0/0/2/1\ninterface TenGigE0/0/2/1 shutdown
    or in an index like this:
    Index | command
    1         interface TenGigE0/0/2/1 description Test: 0-43
    2         interface TenGigE0/0/2/1
    3         interface TenGigE0/0/2/1 shutdown
    Thx

  • Help with EEM TCL / CLI scripting for re-direction/wccp counters

    Being new with EEM scripting I wanted to see if I was on the right track and get some help to finish my idea.
    Our problem I am trying to fix is our remote sites utilize pairs of Cat3650's for some routing and WCCP redirection.  We are encountering ACL denial issues causing slow down and access issues.  The fix for the issue we remove the WCCP service groups to break peering with our wan optimizers and re-insert the configuration thus re-establishing peering and restoring service.
    My idea is to use a TCL scipt on a watchdog timer to parse the "sh ip wccp | inc denied (or unassign)" output for denial and unassignable error counters.  If a counter is found I wanted to create a syslog message that would then kick off a simple EEM CLI script to remove the service groups, wait 10 seconds, then re-add the service groups.  Please point me in the right direction if I am off track as I am not sure if I can use the EEM CLI for all this or since I want to retreive specific info from the sh ip wccp output if I do need to utilize TCL.  I am also unsure if the "total denied" ascii string pulled via the "sh ip wccp | inc denied" will cause issues when attempting to just pull the counter information.
    sh ip wccp | inc Denied Red
            Total Packets Denied Redirect:       0
            Total Packets Denied Redirect:       0
    Script thus far :
    TCL
    if [catch {context_retrieve "EEM_WCCP_ERROR_COUNTER" "count"} result] {
    set wccpcounter 0
    } else {
    set wccpcounter $result
    } if [catch {cli_open} result] {
    error $result
    } else {
    array set cli $result
    } if [catch {cli_exec $cli(fd) "show ip wccp | incl Denied"} result] {
    error $result
    } else {
    set cmd_output $result
    set count ""
    catch [regexp {receive ([0-9]+),} $cmd_output} ignore count]
    set count
    set diff [expr $count - $wccpcounter]
    if {$diff != 0} {
    action_syslog priority emergencies msg "WCCP counters showing incremental Denied packet counts"
    if [catch {cli_close $cli(fd) $cli(tty_id)} result] {
    error $result
    context_save EEM_WCCP_ERROR_COUNTER count
    CLI
    event manager applet WCCP_COUNTER_WATCH
    event syslog priority emergencies pattern "WCCP counters showing incremental Denied packet counts"
    action 001 cli command "enable"
    action 002 cli command "config t"
    action 003 cli command "no ip wccp 61"
    action 004 cli command "no ip wccp 62"
    action 005 wait 10
    action 006 cli command "ip wccp 61"
    action 007 cli command "ip wccp 62"
    action 008 wait 15
    action 009 cli command "clear ip wccp"
    action 010 cli command "end"
    Thanks for all the help

    This won't work as EEM cannot intercept its own syslog messages.  However, I'm not sure why you need this form of IPC anyway.  Why not just make the Tcl script perform the needed CLI commands?
    And, yes, you could use all applets here.  But since you've written the hard stuff in Tcl already, it might be best just to add the missing calls to reconfigure WCCP to that script.

  • Snmp oids for the command "show counters interface intx/y delta"

    Hello,
    I have a question about SNMP OIDs for the command "show counters interface intx/y delta" on Catalyst6500. The customer wants to create graphs for the following values:Overruns, qos0Outlost, InErrors, OutErrors, InDiscards, OutDiscards etc..
    Is possible to get these values using SNMP??
    Thank you
    Roman

    Thank you, Dan. These OIDs are for the output from the command "show interface int x/y". But I think, that these OIDs are not for the command "show interface int x/y delta".
    Roman

  • [Request] Betty: Friendly English-like interface for your command line

    Anyone with the capacities and interest to maintain Betty?
    Betty is a friendly English-like interface for your command line.
    She translates English-like phrases into commands in case you every run into situations like this.
    This means you don't have to leave your command line to look up an obscure but useful command. Just ask Betty!
    Discussion on reddit: http://www.reddit.com/r/linux/comments/ … x_command/
    Source on Github: https://github.com/pickhardt/betty

    I liked a lot of the ideas you posted.  Though I have to disagree with the idea of having tablets being into the size range of over 12".  You start getting larger than that and you may as well start using a laptop. On the flip side of that, I have to agree that there are too many of the 7" available,  which are almost too small.  The 8-10" tablets give you the portability and smaller size people want for stuffing into their bags,  purses, etc. The larger tablets are getting into that bulky area and that defeats the purpose of the tablet to begin with. Unfortunately I find myself using e-books more than I intended,  but I don't need a full, or larger than a full, sized sheet of paper.   They get harder to handle,  even with Lenovo 's great form design.  
    The only reason to have more than one tablet is if the developers can't come to terms and allow their products to be used across the board (talking of Amazon and Google here). I personally don't want to be carrying around more than one tablet and a phone. I want to simplify and streamline not add more bulk. 
    I loved that you pointed out that our voices will never replace our fingers. I don't like speaking to inanimate objects; too many experiences with automated phone services that did not end up well. 
    I congratulate Lenovo for their innovative design with the Yoga tablets. 

  • Troubleshoot QOS - EEM & TCL

    Joe,
    We have another urgent requirement and need to troubleshoot QOS.
    What we need to able to do is
    1, Report Qos drops based on DSCP value. (show policy-map interface command does not work for us!)
    2, Report packet with value of DSCP value 0 ending up in the default-class (Only for troubleshooting )
    Can you assistant us?
    Francisco

    If there are no CLI commands which can provide you with what you need, I'm not sure how EEM is going to help you here.  EEM really only has visibility to the control plane.  EEM 3.0 does offer some Netflow integration, but I do not think you have that version.

  • EEM TCL Policies

    All,
    I am attempting to write a TCL based EEM policy to force users that entering config mode on the router to enter a ticket number from my company's service management platform, since any changes they make to a production system should be tied to either an incident or approved change.  I've got this working based on a TCL script I found on Cisco Beyond.  I utilize a product from Solarwinds (Network Configuration Manager or NCM) to make mass changes across my router install base.  I don't want the credentials that the NCM product uses to have to enter a ticket number as it complicates programming responses on that platform.  I can do it if necessary, but I was hoping there might be a way to make it so that if user "x" is entering config mode the TCL script could bypass the other actions and not prompt for a ticket number.  If this were not an EEM TCL policy I could simply perform an exec command to show users and parse the active line to get the username, then do a regexp match and if it were the NCM user set a flag and use if statements to bypass the other code.  But because it's an EEM TCL policy, exec is available to me, only cli_open, cli_exec, cli_close, which actually opens a new session to the router which negates my previous idea since it's not the actual session of the user that's trying to enter config mode that the show users command would be executing against.  If anyone has any other ideas on how I might do this I'd appreciate the feedback.  Thanks.
    Mike

    Joe,
    Thanks for the response.  I've added your example to the script (modifying for the NCM Username of course), but I'm getting an error I'm not sure how to handle.  The following is what I'm getting:
    invalid command name "*"
        while executing
        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 "system:/lib/tcl/base.tcl" line 50)
    Tcl policy execute failed: invalid command name "*"
    It seems to be trying the execute the wild card in the regular expression used in the cli_exec command.  I'm not familiar enough with TCL to debug this and figure out how to fix it.  If you have any ideas on the matter I'd appreciate it.  Your guidance would be most welcome.  Thanks.
    Mike

  • EEM TCL script configuration issue

    Hi Experts,
    I need help with an EEM TCL script for the CRS platform that generates a SYSLOG message after the CPU reaches a threshold value and then stays over the threshold value for 15 minutes, I've already tryied several thing and the last TCL script that I tested generated the SYSLOG message when the CPU reaches the threshold but I can't seem to find any way to make it wait the 15 min over the threshold and then generate the message.
    My current script looks like this:
    ::cisco::eem::event_register_wdsysmon timewin 900 sub1 cpu_tot op ge val 70
    namespace import ::cisco::eem::*
    namespace import ::cisco::lib::*
    array set event_details [event_reqinfo]
    action_syslog msg "sub1 is $event_details(sub1)"
    action_syslog msg "High CPU threshold value over 70%"
    puts ok
    I've tryied using the 'period' option for the 'cpu_tot' variable but the TCL script was'nt recognized and couldn't be registered, and I'm using the 'timewin' option here but it seems to be wrong as it says it's the time it has for multiple sub-events to ocurr in order for the script to execute.
    timewin
    (Optional) Time window within which all of the subevents have to occur in order for an event to be generated and is specified in SSSSSSSSSS[.MMM] format. SSSSSSSSSS format must be an integer representing seconds between 0 and 4294967295 inclusive. MMM format must be an integer representing milliseconds between 0 and 999).
    Also, the 'period' option I believe wouldn't have worked because I understand that it referrs to the time period that the script will take to monitor the CPU:
    •1. cpu_tot [op gt|ge|eq|ne|lt|le] [val ?] [period ?]
    op
    (Optional) Comparison operator that is used to compare the collected total system CPU usage sample percentage with the specified percentage value. If true, an event is raised.
    val
    (Optional) Percentage value in which the average CPU usage during the sample period is compared.
    period
    (Optional) Time period for averaging the collection of samples and is specified in SSSSSSSSSS[.MMM] format. SSSSSSSSSS format must be an integer representing seconds between 0 and 4294967295, inclusive. MMM format must be an integer representing milliseconds between 0 and 999. If this argument is not specified, the most recent sample is used.
    As I said, I couldn't try this because the script send an error when I tried to register using the following line:
    ::cisco::eem::event_register_wdsysmon sub1 cpu_tot op ge val 70 period 900
    This is the error message that appeared:
    RP/0/RP0/CPU0:CRS(config)#event manager policy test.tcl username cisco
    RP/0/RP0/CPU0:CRS(config)#commit
    Thu Aug 29 12:35:43.569 CDT
    % Failed to commit one or more configuration items during a pseudo-atomic operation. All changes made have been reverted. Please issue 'show configuration failed' from this session to view the errors
    RP/0/RP0/CPU0:CRS(config)#sh conf fail
    Thu Aug 29 12:35:52.427 CDT
    !! SEMANTIC ERRORS: This configuration was rejected by
    !! the system due to semantic errors. The individual
    !! errors with each failed configuration command can be
    !! found below.
    event manager policy test.tcl username cisco persist-time 3600
    !!% Embedded Event Manager configuration: failed to retrieve intermediate registration result for policy test.tcl
    end
    Anyway, to make this work I understand that I need nested TCL scripts that do the following:
    •1. Monitor the CPU and when it reaches the threshold install another TCL policy that counts down 15 min.
    •2. If the second TCL policy reaches zero then it should generate the SYSLOG message.
    •3. Monitor the CPU while this is running and if it falls below the threshold it should stop the second TCL policy.
    I don't know how I can acomplish this so if anyone can help me with this or show me another way to do this I would really appreciate it.
    Thanks in advance for all your help!

    Neither option is likely to do what you want.  The timewin is for correlating multiple events, and period is the polling interval.  What you want is to create a timer when the CPU is first detected as being high, countdown 15 minutes, then alert you.  You can do this with a nested EEM policy.  For example, you can add the following to your existing policy:
    proc get_pol_dir { fd } {
        set res {}
        set output [cli_exec $fd "show event manager directory user policy"]
        set output [string trim $output]
        regsub -all "\r\n" $output "\n" result
        set lines [split $result "\n"]
        foreach line $lines {
            if { $line == "" } {
                continue
            if { ! [regexp {\s} $line] && ! [regexp {#$} $line] } {
                set res $line
                break
        if { $res == {} } {
            return -code error "The user policy directory has not been configured"
        return $res
    if { [catch {cli_open} result] } {
        error $result $errorInfo
    array set cli $result
    set output [cli_exec $cli(fd) "show event manager policy registered | inc tm_alert_high_cpu.tcl"]
    if { [regexp {tm_alert_high_cpu.tcl} $output] } {
        exit 0
    set poldir [get_pol_dir $cli(fd)]
    set polname "${poldir}/tm_alert_high_cpu.tcl"
    set fd [open $polname "w"]
    puts $fd "::cisco::eem::event_register_timer countdown time 900"
    puts $fd "namespace import ::cisco::eem::*"
    puts $fd "namespace import ::cisco::lib::*"
    puts $fd "action_syslog msg \"CPU has been over 70% for 15 minutes\""
    close $fd
    cli_exec $cli(fd) "config t"
    cli_exec $cli(fd) "event manager policy tm_lert_high_cpu.tcl username eem"
    cli_exec $cli(fd) "commit"
    cli_exec $cli(fd) "end"
    catch {cli_close $cli(fd) $cli(tty_id)}
    Additionally, you'll want another permanently configured policy that checks for a low CPU threshold.  Something like:
    ::cisco::eem::event_register_wdsysmon sub1 cpu_tot op le val 10
    namespace import ::cisco::eem::*
    namespace import ::cisco::lib::*
    if { [catch {cli_open} result] } {
        error $result $errorInfo
    array set cli $result
    cli_exec $cli(fd) "config t"
    cli_exec $cli(fd) "no event manager policy tm_alert_high_cpu.tcl"
    cli_exec $cli(fd) "commit"
    cli_exec $cli(fd) "end"
    catch {cli_close $cli(fd) $cli(tty_id)}

  • IOS "interface" command

    Greetings. I am attempting to configure my Cisco 831 router to VPN connect to another server. I have been given IOS commands in order to create the connection, however there is one command that does not seem to be valid with my router and I was hoping someone could help me interpret it. The command is:
    interface fa0/0
    the comment beside this command says: "Assumed as inside interface" and this appears later as:
    interface fa0/1
    with the description "Assumed as Public Internet interface"
    however, when I look at the available commands in interface mode, none resemble "fa0", here are the commands for interface:
    router(config)#interface ?
    Async Async interface
    BVI Bridge-Group Virtual Interface
    CDMA-Ix CDMA Ix interface
    CTunnel CTunnel interface
    Dialer Dialer interface
    Ethernet IEEE 802.3
    FastEthernet FastEthernet IEEE 802.3
    Group-Async Async Group interface
    Lex Lex interface
    Loopback Loopback interface
    MFR Multilink Frame Relay bundle interface
    Multilink Multilink-group interface
    Null Null interface
    Tunnel Tunnel interface
    Vif PGM Multicast Host interface
    Virtual-PPP Virtual PPP interface
    Virtual-Template Virtual Template interface
    Virtual-TokenRing Virtual TokenRing
    range interface range command
    any ideas?

    Paresh, thanks, however it seems "0" is an invalid fastEthernet choice (even though typing "?" says:
    <0-4> FastEthernet interface number
    Why is 0 invalid?
    Also, the command I was told to use is the following:
    interface fa0/1 # Assumed as Public Internet interface
    ip address ##.##.###.### 255.255.255.x #Customer public interface
    I removed the ip address numbers in this post for my own security, however the .x was exactly as the instructions said to use. I replaced this with 255.255.255.0 (as that is my subnet mask, and that's what I figured they were asking for), however I get the following message:
    IP addresses may not be configured on L2 links.
    what does that mean? (and thanks again for the help).

  • VLAN Interface Command

    Ok, I thought I had the reason for the VLAN interface command down. I thought it was either used for switch management or routing between VLANS? However, now I realized that some communication wont work with out this command which doesnt make sense. If I have a VLAN, then the switch will only switch packets to ports on the same VLAN. The only way, communication would work between VLANS is if I either enabled routing between VLANs with the VLAN Interface command, connected the switch to another multi-layer switch that did do routing between VLANS, or connected the switch to a router which routed between the VLANs.
    However, I just got this new 3550 switch in, configured the correct ports with the assigned VLANs, and the only way my cisco ip phone would work is if the VLAN Interface for my voice-ip VLAN was configured. The 3550 is connected to a 4507. Now, can someone tell my why this is? You shouldnt have to configure the VLAN Interface, right?(unless I wanted to route between VLANs, which could be done by the 4507)

    Sounds to me like you either dont have the dot1q trunk interface between your 4506 and 3550 working properly, or your 3550 is running the enhanced image which allows routing.
    It would be nice to see your config on both the 3550 and the 4500 to determine the reason. Just a stab at how it should be configured is that on your 4506, you have it running VTP server or transparent with the defined Data and Voice Vlan's. You have a port configured for trunking (which connects to the 3550). On your 3550, you have configured it as a vtp client or transparent and have verified that it has received (or if transparent VTP you have configured) the appropriate VLAN's. You than specified "interface VLAN #" or whatever number for switch management and configured the port that connects to the 4500 as a trunk. Your port connected to the port has the auxillary or voice vlan configured. If this is how your equipment is configured and it still does not work, than look for the line "ip routing" in your 3550 and negate it with "no ip routing".
    If still no worky worky, post your config.
    Cheers,

  • Passive interface command on RIP

    Hi all,
    This command below
    passive-interface command give additional information to RIP, that it can't send updates via this particular interface ---
    As per my understanding is this if we have 2 routers that are directly connected with each other and we enable this command on the interface of one of
    routers then that router will not send any RIP updates to other router right?
    secondly if these 2 routers are point to point connection we can ping directly conencted interfaces IP of  routers because they are directly connected even though there is no routing protocol running between these two right?
    3rd thing when i run sh ip protocols on one of router it shows
    Routing Protocol is "rip"
      Sending updates every 30 seconds, next due in 1 seconds
      Invalid after 180 seconds, hold down 180, flushed after 240
      Outgoing update filter list for all interfaces is not set
      Incoming update filter list for all interfaces is not set
      Redistributing: rip
      Default version control: send version 2, receive version 2
        Interface             Send  Recv  Triggered RIP  Key-chain
        FastEthernet0/0       2     2
      Automatic network summarization is in effect
      Maximum path: 4
      Routing for Networks:
        192.168.4.0
      Routing Information Sources:
        Gateway         Distance      Last Update
        192.168.4.2          120      00:23:38 ****************************************************
    here last update time keeps on incrementing but  sh ip route does not show now that rip is running.
    so this line means
    Invalid after 180 seconds, hold down 180, flushed after 240
    that after 240 secs router will flush the rip routes fron the routing table right?
    but sh ip protocol  will always show rip as routing protocol as we have config the rip and last update time will keep on incrementing right?
    thanks
    mahesh

    Hi Mahesh,
    From the config guide:
    To control the set of interfaces with which you  want to exchange routing updates, you can disable the sending of routing  updates on specified interfaces by configuring the
    passive-interface
    here is the link:
    http://www.cisco.com/en/US/docs/ios/12_0/np1/configuration/guide/1crip.html
    Correct, you do not need a routing protocol.  The interfaces are directly connected.  Now, if for example you add a loopback address to each router, you need a routing protocol or static router to reach the opposite router's loopback address.
    The reason the interfaces/IPs do not show up in the RIP routing table is because they are directly connected and directly connected routes have a lower admin distance (1) which is preferred over rip which is 120.
    yes
    HTH

  • IP SLA EEM/Tcl Scripts

    Hello Community,
    I have been testing a EEM/Tcl scripts for IP SLA. However, after testing I realised that the script didn't go far enough in identifying the link(s) that has actually gone down.
    I was wondering if someone knows any good EEM/Tcl scripts for IP SLA?
    Cheers
    Carlton

    What about it doesn't work?  Is the policy not triggering?  Is the IPSLA operation not transitioning state?

  • Stopping EEM/TCL script

    How can I stop a pending EEM/TCL script?  I have a Catalyst 4506 version 12.2(40)SG.  The command 'event manager scheduler clear' isn't available.  The output of 'show event manager policy pending' shows:
    No.  Time of Event             Event Type          Name
    1    Wed Mar 3  09:39:31 2010  none                script: test_err.tcl
    2    Wed Mar 3  10:56:42 2010  timer watchdog      script: free_mem.tcl
    3    Wed Mar 3  11:43:19 2010  syslog              applet: Login-Fail
    So the policies coming after the stuck policy won't run.  I've tried to un-register/re-register the policy, but it didn't help.

    If your device does not support "event manager scheduler clear" the only way to terminate a stuck, or long-running EEM policy is to reboot.

  • Basic traceroute EEM script (for hop-by-hop network analysis)

    I'd like to do a hop-by-hop analysis by running a traceroute script that runs on an interval (say every 5-15 minutes) and puts output to a file.
    The goal is to let the script run for a day, and see what kind of hop changes might occur over time, and also monitor for any latency increase or packetloss at certain times of day (peak hours).
    If I used an EEM script to do a basic traceroute from one endpoint of the network to a server in the core (for instance), this could show how a client's path may be impacted during peak hours.
    I'd want the output stored in a file on the router's flash disk, and then I'd have to find some way to parse and analyze the output later (not sure how I'd do that, perhaps with excel or another diff-like program).

    Something like this should work for you.  In config mode, specify three EEM environment variables:
    event manager environment traceroute_timer 600
    event manager environment traceroute_target 10.1.1.1
    event manager environment traceroute_file flash:/traceroute.txt
    Then register this EEM Tcl policy:
    ::cisco::eem::event_register_timer watchdog time $traceroute_timer
    namespace import ::cisco::eem::*
    namespace import ::cisco::lib::*
    array set arr_einfo [event_reqinfo]
    if [catch {cli_open} result] {
        error $result $errorInfo
    } else {
        array set cli1 $result
    if [catch {cli_exec $cli1(fd) "enable"} _cli_result] {
        error $_cli_result $errorInfo
    if [catch {cli_exec $cli1(fd) "traceroute $traceroute_target"} _cli_result] {
        error $_cli_result $errorInfo
    set fd [open $traceroute_file a]
    puts $fd [clock format [clock seconds]]
    puts $fd $_cli_result
    close $fd
    # Close open cli before exit.
    catch {cli_close $cli1(fd) $cli1(tty_id)} result

Maybe you are looking for

  • Crystal Reports - Web Intelligence

    Our customer has some reports defined in Crystal Reports XI. Is it possible to change / port / convert a RPT (Crystal Reports) file to a REP (Web Intelligence Reporter) file? They are currently on Web Intelligence 6.5 but moving to XI R2. Thanks very

  • Numbering format not staying intact

    The numbering format looks fine in RoboHelp 9, but when I generate a WebHelp Primary Layout, the numbering gets thrown off. It's difficult, if not impossible to fix, because it looks ok in RoboHelp!! Any ideas?

  • IPhoto version - OS X Version

    Hello there, I try to put the story short :-) In the past I bourght OS X DVD and iLife DVD to install it. Did this until OS X 10.6.8 (Snow Leopard) after this I updated via App Store to OS X 10.7.5 (OS X Lion). I cannot upgrade any longer because my

  • Command to run recovery factory

    I need the command to run recovery factory in Toshiba Satellite L655D-55050.

  • Query based Data Block?

    I have a situation where on the detail portion of the screen, I need to have fields from 2 tables shown that can be updated. The 2 tables are related through a foreign key. Can you have a data block based upon a query? If so, how... Thanks.