Using EEM and TCL scripts for voice

HI all,
I'd like to use eem to check Sip dial-peer status+interface BRI status, when sip dial-peer has no answer to invite and bri interface is down the LAN interface must be shutted down. Is it possible to avhieve it using eem? I didn't find anything for eem monitoring sip dial-peers...
thanks
Massimiliano

EEM doesn't have any ability to control the data plane currently.  Therefore, there is no direct voice tie-in.  There is a way to do Tcl scripting of some voice operations (e.g. IVR scripts), but those do not relate to EEM.
That said, if there are some show commands which provide you the data you need, you can create an EEM timer policy (i.e. one that runs periodically), parsers the show command output, and takes further action if the output contains certain patterns.  Depending on the version of IOS, this may require an EEM Tcl script, or you may be able to do it within an EEM applet.
If you need further assistance, you will need to provide your IOS version, and the exact commands (and output) which would tell you if the SIP peer isn't getting an answer and the BRI interface is truly down (I'm imagining something like "show isdn status" for this one).
Please support CSC Helps Haiti
https://supportforums.cisco.com/docs/DOC-8895
https://supportforums.cisco.com

Similar Messages

  • EEM And Tcl scripts

    Hi
    Please teach me. How to implementation EEM.
    I want use EEM this situation.
    When gi1/1 detect down EEM scripts enable.
    In case gi1/1 is up  within 3 seconds then finish the EEM scripts.
    Another case gi1/1 down time is over 3 seconds, Then shutdown gi1/2 and gi1/3.
    IOS version 12.2(46)SG.

    You have a tight time margin here, but these EEM applet policies should work:
    event manager environment quote "event manager applet int-down event syslog pattern "LINEPROTO-5-UPDOWN.*GigabitEthernet1/1.*changed state to down" action 1.0 cli command "enable" action 2.0 cli command "config t" action 3.0 cli command "event manager applet int-down-countdown" action 3.1 cli command "event timer countdown time 3" action 3.2 cli command "action 1.0 cli command enable" action 3.3 cli command "action 2.0 cli command $quote config t$quote" action 3.4 cli command "action 3.0 cli command $quote int gi1/2$quote" action 3.5 cli command "action 4.0 cli command $quote shutdown$quote" action 3.6 cli command "action 5.0 cli command $quote int gi1/3$quote" action 3.7 cli command "action 6.0 cli command $quote shutdown$quote" action 3.8 cli command "action 7.0 cli command $quote no event manager applet int-down-countdown$quote" action 3.9 cli command "action 8.0 cli command $quote end$quote" action 4.0 cli command "end"event manager applet int-up event syslog pattern "LINEPROTO-5-UPDOWN.*GigabitEthernet1/1.*changed state to up" action 1.0 cli command "enable" action 2.0 cli command "config t" action 3.0 cli command "no event manager applet int-down-countdown" action 4.0 cli command "end"

  • EEM and TcL Script to Disable Inactive Ports

    I've browsed around to the other  support strings to make sure I didn't miss anything, but I can't seem to  get this to work.  I have the latest sl_suspend_ports.tcl and  tm_suspend_ports.tcl created by Joseph Clarke from strings that verified they worked as planned.   Here are the commands I issued to register the scripts -
    Directory of flash:/policies/
        9  -rwx        3101   May 3 2013 07:58:03 +00:00  sl_suspend_ports.tcl
       10  -rwx        4669   May 3 2013 07:58:44 +00:00  tm_suspend_ports.tcl
    conf t
    event manager directory user policy flash:/policies
    event manager policy sl_suspend_ports.tcl
    event manager environment suspend_ports_days 1
    event manager environment suspend_ports_config flash:/susp_ports.dat
    event manager policy tm_suspend_ports.tcl
    #show run | inc event manager environment
    event manager environment suspend_ports_days 1
    event manager environment suspend_ports_config flash:/susp_ports.dat
    It doesn't appear to work though.  Essentially, we have a  need to make sure all computers are always on and all ports not active  for >24 hours to be shutdown and moved to a designated vlan (I added  the 'lappend' statement to the script to specify the additional command of assigning the vlan)
    I'm running 12.2(55)SE7 on Catalyst 3560s and 3750s
    Is there a way to manually run the script?  Did I miss anything in the configuration?
    Thanks for your help!
    Chris

    SUCCESS!  AWESOME!
    I added one more line to the lappend statements to add a description with the time stamp, here's what happened -
    Port      Name               Status       Vlan       Duplex  Speed Type
    Fa0/2     Disable by Inactiv disabled     666          auto   auto 10/100BaseTX
    Fa0/3     Disable by Inactiv disabled     666          auto   auto 10/100BaseTX
    Fa0/4     Disable by Inactiv disabled     666          auto   auto 10/100BaseTX
    Fa0/5     Disable by Inactiv disabled     666          auto   auto 10/100BaseTX
    Fa0/6     Disable by Inactiv disabled     666          auto   auto 10/100BaseTX
    Fa0/7     Disable by Inactiv disabled     666          auto   auto 10/100BaseTX
    Fa0/8     Disable by Inactiv disabled     666          auto   auto 10/100BaseTX
    Fa0/9     Disable by Inactiv disabled     666          auto   auto 10/100BaseTX
    Fa0/10    Disable by Inactiv disabled     666          auto   auto 10/100BaseTX
    #sh run int fa0/2
    Building configuration...
    Current configuration : 408 bytes
    interface FastEthernet0/2
    description Disable by Inactivity Script last used on Tue May 14 04:32:10 ZULU 2013
    switchport access vlan 666
    shutdown
    end
    So to recap for any future folks that stumble upon this thread and want to use this method. 
    1. Create a TACACS service account or use a TACACS/RADIUS account that has a high enough privilege to edit the config.
    2. Create a "policies" directory on flash and copy the attached scripts to it.
    3. Register the scripts using the following commands -
    #conf t
    (config)#event manager directory user policy flash:/policies
    (config)#event manager policy sl_suspend_ports.tcl
    (config)#event manager environment suspend_ports_days 1    "<--Or the number of days inactive you choose"
    (config)#event manager environment suspend_ports_config flash:/susp_ports.dat
    (config)#event manager policy tm_suspend_ports.tcl
    (config)#event manager session cli username "svc.eemscript"  "<---The account you created to run in step 1"
    The output of "show event manager policy registered" should then show the following -
    #show event manager policy registered
    No.  Class     Type    Event Type          Trap  Time Registered           Secu  Name
    1    script    user    syslog              Off   Fri May 3 10:20:26 2013   2048  sl_suspend_ports.tcl
    pattern {LINEPROTO-5-UPDOWN}
    nice 0 queue-priority normal maxrun 600.000 scheduler rp_primary
    2    script    user    timer cron          Off   Tue May 14 05:25:42 2013  2048  tm_suspend_ports.tcl
    cron entry {0 0 * * *}
    nice 0 queue-priority normal maxrun 600.000 scheduler rp_primary
    NOTE: On lines 140-145 of the tm_suspend_ports.tcl file, you can edit the commands you want the script to execute to your liking.  I have it adding a description as seen in the above output and moving to an isolated non-routable VLAN of my network.
    Thanks Joe Clarke for the awesome script and assistance in getting it running!

  • TcL Scripting for Cisco IOS,

    anyone has idea how useful this book
    TcL Scripting for Cisco IOS,
    http://www.ciscopress.com/bookstore/product.asp?isbn=1587059541
    thank you

    Hi Joe
    it is interesting that you are the technical reviewer of this book
    i was think to get mid level in Tcl scripting with EEM to give me the ability to  implement some automated things
    i am good with EEM but Tcl not
    will this book take the reader from scratch to tcl scripting ?
    thank you and happy new year
    Marwan

  • Problem : tcl script for filter IPSec cosmetic log

    Hi all, I would like some advice from anyone who ever see this case. I applied tcl script for filter ipsec error log that log is cosmetic. But my site want to don't see this log from router log. I already create tcl script for filter it out. Ok script can work fine but it more work. It filter other message not just ipsec log out. I check cisco device that support script. How can I fix this problem.
    See my detail of script and ios version of router :
    script :
    # VPN_Error.tcl  This script deletes all log messages about VPN error messages
    # The script will filter by combination between facility-serverity and mnemonic      
    # Created on 05-Oct-2012.
    set msgs [list {CRYPTO-4-RECVD_PKT_MAC_ERR} {VPN_HW-1-PACKET_ERROR} {CRYPTO-4-RECVD_PKT_NOT_IPSEC} {CRYPTO-4-PKT_REPLAY_ERR}]
    set fac_sev_mnem "${::facility}-${::severity}-${::mnemonic}"
    foreach msg $msgs {
        if { $msg == $fac_sev_mnem } {
        return ""
    return $::orig_msg
    ios router version :
    : c2800nm-adventerprisek9-mz.124-25f.bin
    : c2800nm-adventerprisek9-mz.124-7b.bin
    log information and configuration
    When I applied command:
    logging filter flash:VPN_Filter2.tcl
    logging buffered filtered 4096 debugging
    show log file:
    router#sh logg
    Syslog logging: enabled (11 messages dropped, 1 messages rate-limited,
                    0 flushes, 0 overruns, xml disabled, filtering enabled)
        Console logging: level debugging, 18145 messages logged, xml disabled,
                         filtering disabled
        Monitor logging: level debugging, 428 messages logged, xml disabled,
                         filtering disabled
            Logging to: vty322(2)
        Buffer logging: level debugging, 0 messages logged, xml disabled,
                        filtering enabled (0 messages logged)
        Logging Exception size (4096 bytes)
        Count and timestamp logging messages: disabled
    Filter modules:
        flash:VPN_Filter2.tcl  
        Trap logging: level informational, 47011 message lines logged
            Logging to 10.145.0.25 (udp port 514, audit disabled, link up), 47011 message lines logged, xml disabled,
                   filtering disabled
            Logging to 10.247.17.41 (udp port 514, audit disabled, link up), 47011 message lines logged, xml disabled,
                   filtering disabled
            Logging to 10.247.17.45 (udp port 514, audit disabled, link up), 47011 message lines logged, xml disabled,
                   filtering disabled
    --More--                          
    Log Buffer (4096 bytes):
    router#
    If you have some more information. Please tell me.
    Thank you for your advice

    It looks like your script has an error.  You have an extra '}'.  It should be:
    # VPN_Error.tcl  This script deletes all log messages about VPN error messages# The script will filter by combination between facility-serverity and mnemonic       # Created on 05-Oct-2012.#set msgs [list {CRYPTO-4-RECVD_PKT_MAC_ERR} {VPN_HW-1-PACKET_ERROR} {CRYPTO-4-RECVD_PKT_NOT_IPSEC} {CRYPTO-4-PKT_REPLAY_ERR}]set fac_sev_mnem "${::facility}-${::severity}-${::mnemonic}"foreach msg $msgs {    if { $msg == $fac_sev_mnem } {        return ""    } } return $::orig_msg

  • Startup and Shutdown scripts for OCS 9.0.4 on Windows?

    Hi,
    I wanted to know if startup and shutdown scripts for OCS 9.0.4 on Windows are available.
    I am thinking something like the ocsctl_sample scripts that OCS10g included.
    I have checked the OCS 9.0.4 documentation and not a lot of information for the windows platform is avaiable.
    Any information will be appreciated.
    Thanks,
    Ana

    There is no scripts that comes with 9.0.4.
    One possibility is to just write the commands you normally use in a batch-file, but note that then you have no checking, and if OCS runs on several machines you should have some checking for required processes etc.
    We are using some scripts that does this, but I'm not shure where they came from, possibly from Metalink or from this forum. Try a search. Our scripts are changed quite a bit for our needs, but I might be able to find the original ones.

  • I have just bought a new Imac and it will not load my copy of FCE 3.5 as it says "PowerPC applications are no longer supported". So how do I get to use the version of FCE I am used to and have paid for ?

    I have just bought a new Imac and it will not load my copy of FCE 3.5 as it says "PowerPC applications are no longer supported". So how do I get to use the version of FCE I am used to and have paid for ?

    I do not have any experience with Final Cut, but if you have existing projects that you MUST access; then you are in need of a solution on your new iMac in Mountain Lion!
    Unfortunately you got caught up in the minor miracle of Rosetta.  Originally licensed by Apple when it migrated from the PowerPC CPU platform that it had used from the mid-1990's until the Intel CPU platform in 2006, Rosetta allowed Mac users to continue to use their library of PPC software transparently in emulation.
    However, Apple's license to continue to use this technology expired with new releases of OS X commencing with Lion (and now Mountain Lion).  While educational efforts have been made over the last 6 years, the fact is that Rosetta was SO successful that many users were caught unaware UNTIL they upgraded to Lion or Mountain Lion.
    Workarounds:
    1.  Purchase a used Mac that will run Snow Leopard (with the optional Rosetta installed) and continue to run FCE on that Mac (you can actually use Screen Sharing with a "headless" used Snow Leopard Mac Mini and use the 27" screen from your iMac to view and work FCE in the Mac Mini environment);
    2.  Upgrade to an Intel compatible version of FCE and hope it converts your existing projects to its newer format correctly.  There is much debate that the newer version of Final Cut are eliminating many needed features; for example Final Cut Pro X vs. Final Cut Pro 6 -- many users are staying with version 6;
    3.  Install Snow Leopard (with Rosetta) into Parallels and then install FCE in the Snow Leopard environment:
                                  [click on image to enlarge]
    Full Snow Leopard installation instructions here:
    http://forums.macrumors.com/showthread.php?t=1365439
    NOTE: STEP ONE of the instructions must currently be completed on a Snow Leopard or Lion Mac and the resulting modified Snow Leopard.cdr install file can then be moved over to your Mountain Lion Mac for completion of the remaining steps.
    NOTE 2:  Computer games with complex, 3D or fast motion graphics make not work well or at all in virtualization.

  • Last week I found records of purchases for 3 files using itunes, and left money for my credit card, do not make such purchases, what the **** is going on? itunes is not safe?

    ast week I found records of purchases for 3 files using itunes, and left money for my credit card, do not make such purchases, what the **** is going on? itunes is not safe?

    Contact iTunes support at the link below.
    https://ssl.apple.com/emea/support/itunes/contact.html

  • Configuration of zprintprogram and z script for F-58

    hi
    i have created zprintprogram and z script for F-58
    then how i can configure this
    regards

    Hi ,
    check in SPRO
    search for Payment method in SPRO , or check table  T042Z
    regards
    Prabhu

  • PeopleSoft - Backup and Restore scripts for PeopleSoft implementation using MS-SQL 2012?

    I am working for a county government as a consultant for PeopleSoft using SQL Server. When they restore a DEV instance from PROD, they have to manually stop the web server, app server and batch server, then they do the restore. Afterward they have to change
    all references to PROD in the cloned DEV instance. Everything is done manually and takes a couple of hours.
    Can anyone point me to scripts for PeopleSoft restores that automate bringing down/up the web, app and batch servers and all the other tasks so they don't have to be done manually?
    Life is hard, but it's harder when you're stupid! John 'Duke' Wayne

    This question should be posted on PeopleSoft support forum. That being said, a quick search on the internet will provide helpful links like below: http://www.erpassociates.com/peoplesoft-corner-wiki/peoplesoft-administration/cloning-a-peoplesoft-database.html
    Satish Kartan www.sqlfood.com

  • Signing byte-encoded TCL script for EEM

    Good day,
    I am trying to figure out how to sign a TCL script which is distributed in byte-encoded form.
    The byte coding is performed with TCL pro (http://sourceforge.net/projects/tclpro/files/TclPro-1.4.1/)
    Any pointers on how to do it will be much appreciated.
    Regards,
    Alexei

    EEM 3.4 should support third party signing of Tcl policies.  As to whether or not byte-code compiled policies will be supported is uncertain.  However, you should be able to sign a byte-code compiled Tcl script (regular Tcl script, and not EEM policy) by putting the signature after the closing tbcload '}'.  I assume the same thing will eventually be doable with EEM.

  • Setting the source-interface in a tcl script for email.

    So once again I am trying to figure this out and failing miserably. The only thin I can think of at the moment is that I need to tell it to source from a specific vrf interface. I've tried looking through possible enviornment variables. Hoping I could set it that way but have yet to find one. I have read varios settings for source-interface and attempted them. But fail every time with:
    vpn_failure.tcl: smtp_send_email: error connecting to mail server:
    EEM Version:
    sho event manager version
    Embedded Event Manager Version 4.00
    Component Versions:
    eem: (rel4)1.0.4
    eem-gold: (rel1)1.0.2
    eem-call-home: (rel2)1.0.0
    Below is the stock format for sending the email from the script. If someone could guide me in the correct way to set this up to source the interface that would be awesome.
    # create mail form
      action_syslog msg "Creating mail header for vpn_failure.tcl script..."
      set body [format "Mailservername: %s" "$_email_server"]
      set body [format "%s\nFrom: %s" "$body" "$_email_from"]
      set body [format "%s\nTo: %s" "$body" "$_email_to"]
      set _email_cc ""
      set body [format "%s\nCc: %s" "$body" ""]
      set body [format "%s\nSubject: %s\n" "$body" "VPN Failure Detected: Router $routername Crypto tunnel is DOWN. Peer $remote_peer"]
      set body [format "%s\n%s" "$body" "Report Summary:"]
      set body [format "%s\n%s" "$body" "   - syslog message"]
      set body [format "%s\n%s" "$body" "   - summary of interface(s) in an up/down state"]
      set body [format "%s\n%s" "$body" "   - show ip route $remote_peer"]
      set body [format "%s\n%s" "$body" "   - show crypto isakmp sa"]
      set body [format "%s\n%s" "$body" "   - show crypto session detail"]
      set body [format "%s\n%s" "$body" "   - show crypto engine connection active"]
      set body [format "%s\n%s" "$body" "   - show ip nhrp detail (DMVPN only)"]
      set body [format "%s\n%s" "$body" "   - show log"]
      set body [format "%s\n\n%s" "$body" "---------- syslog message ----------"]
      set body [format "%s\n%s" "$body" "$syslog_msg"]
      set body [format "%s\n\n%s" "$body" "---------- summary of interface(s) in an up/down state ----------"]
      set body [format "%s\n\n%s" "$body" "$show_ip_interface_brief_up_down"]
      set body [format "%s\n\n%s" "$body" "---------- show ip route $remote_peer ----------"]
      set body [format "%s\n\n%s" "$body" "$show_ip_route"]
      set body [format "%s\n\n%s" "$body" "---------- show crypto isakmp sa ----------"]
      set body [format "%s\n\n%s" "$body" "$show_crypto_isakmp_sa"]
      set body [format "%s\n\n%s" "$body" "---------- show crypto session detail ----------"]
      set body [format "%s\n\n%s" "$body" "$show_crypto_session_detail"]
      set body [format "%s\n\n%s" "$body" "---------- show crypto engine connection active ----------"]
      set body [format "%s\n\n%s" "$body" "$show_crypto_engine_connection_active"]
      set body [format "%s\n\n%s" "$body" "---------- show ip nhrp detail (DMVPN only) ----------"]
      set body [format "%s\n\n%s" "$body" "$show_ip_nhrp_detail"]
      set body [format "%s\n\n%s" "$body" "---------- show log ----------"]
      set body [format "%s\n\n%s" "$body" "$show_log"]
      if [catch {smtp_send_email $body} result] {
        action_syslog msg "smtp_send_email: $result"

    I got this far, saw the MAXRUN error, bumped that out and then turned on debugging. I am still not connecting to the mail server. So I don't think I am reaching the mail server yet. I don't think it is using the sourceinterface. In debugging everyting in the script works except for the mail portion.
    Jul 29 16:01:00.334: %HA_EM-6-LOG: vpn_failure.tcl: Creating mail header for vpn_failure.tcl script...
    Jul 29 16:02:36.464: %HA_EM-6-LOG: vpn_failure.tcl: Process Forced Exit- MAXRUN timer expired.
    Jul 29 16:02:36.464: %HA_EM-6-LOG: vpn_failure.tcl:     while executing
    Jul 29 16:02:36.464: %HA_EM-6-LOG: vpn_failure.tcl: "action_syslog msg "smtp_send_email: $result""
    Jul 29 16:02:36.464: %HA_EM-6-LOG: vpn_failure.tcl:     invoked from within
    Jul 29 16:02:36.464: %HA_EM-6-LOG: vpn_failure.tcl: "$slave eval $Contents"
    Jul 29 16:02:36.464: %HA_EM-6-LOG: vpn_failure.tcl:     (procedure "eval_script" line 7)
    Jul 29 16:02:36.464: %HA_EM-6-LOG: vpn_failure.tcl:     invoked from within
    Jul 29 16:02:36.464: %HA_EM-6-LOG: vpn_failure.tcl: "eval_script slave $scriptname"
    Jul 29 16:02:36.464: %HA_EM-6-LOG: vpn_failure.tcl:     invoked from within
    Jul 29 16:02:36.464: %HA_EM-6-LOG: vpn_failure.tcl: "if {$security_level == 1} {       #untrusted script
    Jul 29 16:02:36.464: %HA_EM-6-LOG: vpn_failure.tcl:      interp create -safe slave
    Jul 29 16:02:36.464: %HA_EM-6-LOG: vpn_failure.tcl:      interp share {} stdin slave
    Jul 29 16:02:36.464: %HA_EM-6-LOG: vpn_failure.tcl:      interp share {} stdout slave
    Jul 29 16:02:36.464: %HA_EM-6-LOG: vpn_failure.tcl: ..."
    Jul 29 16:02:36.464: %HA_EM-6-LOG: vpn_failure.tcl:     (file "tmpsys:/lib/tcl/base.tcl" line 50)
    Jul 29 16:02:36.465: %HA_EM-6-LOG: vpn_failure.tcl: Tcl policy execute failed:
    Jul 29 16:02:36.465: %HA_EM-6-LOG: vpn_failure.tcl: Process Forced Exit- MAXRUN timer expired.
    Debugging On:
    Jul 29 16:28:51.471: [fh_smtp_debug_cmd]
    Jul 29 16:28:51.472: %HA_EM-6-LOG: vpn_failure.tcl : DEBUG(smtp_lib) : smtp_connect : attempt 2
    Jul 29 16:29:24.473: [fh_smtp_debug_cmd]
    Jul 29 16:29:24.473: %HA_EM-6-LOG: vpn_failure.tcl : DEBUG(smtp_lib) : smtp_connect : attempt 3
    Jul 29 16:29:57.475: [fh_smtp_debug_cmd]
    Jul 29 16:29:57.475: %HA_EM-6-LOG: vpn_failure.tcl : DEBUG(smtp_lib) : smtp_connect : attempt 4
    Jul 29 16:30:30.478: [fh_smtp_debug_cmd]
    Jul 29 16:30:30.479: %HA_EM-6-LOG: vpn_failure.tcl : DEBUG(smtp_lib) : smtp_connect : attempt 5
    Jul 29 16:31:00.482: %HA_EM-6-LOG: vpn_failure.tcl: smtp_send_email: error connecting to mail server:
    cannot connect to all the candidate mail servers
    Jul 29 16:31:00.483: %HA_EM-6-LOG: vpn_failure.tcl: vpn_failure.tcl script completed
    event manager environment _email_server 10.79.1.126
    event manager environment _email_from [email protected]
    event manager environment _email_to [email protected]
    interface Port-channel1.101
    description MGMT-1
    encapsulation dot1Q 101
    vrf forwarding MGMT-1
    ip address 10.79.1.252 255.255.255.0
    ip nat inside
    ip virtual-reassembly
    redundancy rii 101
    redundancy group 2 ip 10.79.1.254 exclusive decrement 10
    end
    #----------------------- send mail ----------------------
    # create mail form
      action_syslog msg "Creating mail header for vpn_failure.tcl script..."
      set body [format "Mailservername: %s" "$_email_server"]
      set body [format "%s\nFrom: %s" "$body" "$_email_from"]
      set body [format "%s\nTo: %s" "$body" "$_email_to"]
      set _email_cc ""
      set body [format "%s\nCc: %s" "$body" "[email protected]"]
      set body [format "%s\nSourceintf: %s" "$body" "port-channel1.101"]
      set body [format "%s\nSubject: %s\n" "$body" "VPN Failure Detected: Router $routername Crypto tunnel is DOWN. Peer $remote_peer"]
      set body [format "%s\n%s" "$body" "Report Summary:"]
      set body [format "%s\n%s" "$body" "   - syslog message"]
      set body [format "%s\n%s" "$body" "   - summary of interface(s) in an up/down state"]
      set body [format "%s\n%s" "$body" "   - show ip route $remote_peer"]
      set body [format "%s\n%s" "$body" "   - show crypto isakmp sa"]
      set body [format "%s\n%s" "$body" "   - show crypto session detail"]
      set body [format "%s\n%s" "$body" "   - show crypto engine connection active"]
      set body [format "%s\n%s" "$body" "   - show ip nhrp detail (DMVPN only)"]
      set body [format "%s\n%s" "$body" "   - show log"]
      set body [format "%s\n\n%s" "$body" "---------- syslog message ----------"]
      set body [format "%s\n%s" "$body" "$syslog_msg"]
      set body [format "%s\n\n%s" "$body" "---------- summary of interface(s) in an up/down state ----------"]
      set body [format "%s\n\n%s" "$body" "$show_ip_interface_brief_up_down"]
      set body [format "%s\n\n%s" "$body" "---------- show ip route $remote_peer ----------"]
      set body [format "%s\n\n%s" "$body" "$show_ip_route"]
      set body [format "%s\n\n%s" "$body" "---------- show crypto isakmp sa ----------"]
      set body [format "%s\n\n%s" "$body" "$show_crypto_isakmp_sa"]
      set body [format "%s\n\n%s" "$body" "---------- show crypto session detail ----------"]
      set body [format "%s\n\n%s" "$body" "$show_crypto_session_detail"]
      set body [format "%s\n\n%s" "$body" "---------- show crypto engine connection active ----------"]
      set body [format "%s\n\n%s" "$body" "$show_crypto_engine_connection_active"]
      set body [format "%s\n\n%s" "$body" "---------- show ip nhrp detail (DMVPN only) ----------"]
      set body [format "%s\n\n%s" "$body" "$show_ip_nhrp_detail"]
      set body [format "%s\n\n%s" "$body" "---------- show log ----------"]
      set body [format "%s\n\n%s" "$body" "$show_log"]
      if [catch {smtp_send_email $body} result] {
        action_syslog msg "smtp_send_email: $result"
      action_syslog msg "vpn_failure.tcl script completed"
    #------------------ end of send mail --------------------

  • Tcl scripting for snmp

    I am trying to make a script that will give me the uptime of the router and send it to a database. The problem I have, the part of the script that doesn't work, work if I execute it from the tclshell on the router.
    tcl
    set value [snmp_getone public 1.3.6.1.2.1.1.3.0]
    regexp {oid='(.*)'.*val='(.*)'} $value ignore oid _snmp_result
    set _snmp_result [expr $_snmp_result]
    Has you can see, it work well and give me the information I want.
    router#tclsh
    router(tcl)#set value [snmp_getone public 1.3.6.1.2.1.1.3.0]
    {<obj oid='sysUpTime.0' val='1810190'/>}
    stnley600(tcl)#regexp {oid='(.*)'.*val='(.*)'} $value ignore oid _snmp_result
    1
    router(tcl)#set _snmp_result [expr $_snmp_result]
    1810190
    But if I execute from a tcl file I have an error that tell me it didn't recognize the command snmp_getone
    router#event manager run routeruptime.tcl
    invalid command name "snmp_getone"
        while executing
    "snmp_getone public 1.3.6.1.2.1.1.3.0"
        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: invalid command name "snmp_getone"
    I am wondering if I need to import something else. Right now, all I have is this
    ::cisco::eem::event_register_none
    namespace import ::cisco::eem::*
    namespace import ::cisco::lib::*
    I am not a pro in tcl scripting so your help would be very appreciated.
    Thanks

    You are mixing tclsh code with EEM Tcl code.  The snmp_* commands are not available in EEM Tcl.  If you want to get SNMP data in an EEM Tcl policy, you need to use the sys_reqinfo_snmp command.  In your example, this code should work:
    array set snmp_res [sys_reqinfo_snmp oid 1.3.6.1.2.1.1.3.0 get_type exact]set snmp_val $snmp_res(value)action_syslog msg "Uptime is $snmp_val timeticks"

  • Anybody who wants to create a  small and simple Script for me?

    Hi,
    I am kind of new to Mac and totally AppleScript illiterate, but maybe there is a kind soul amongst all of you that can create an "easy" script for me?
    Well, here it goes:
    Every time I boot up my iMac, two things happen, the first is that I programed the "System Preferences" window to open automatically and display the "Energy Saver" section on the "Sleep" sub-section, so far so good and the second thing is that no matter what I have tried to avoid it, the "Customize" window for a program named "Butler" opens also.
    Now for the request:
    I would like the "System Preference window which displays the Energy Saver section" to change from "Sleep" to "Options" and while being there(in options), to tick(select) AND UN-tick(Un-select) immediately after the "Automatically reduce the brightness of the display before display sleep" Option.
    After doing all of this, the window should be closed.
    Now, is it possible to create a Script that performs all of the above and besides closes the "Butler" window afterwards?
    I know I am asking too much, but I know too that maybe there is someone with a heart of gold and the sufficient knowledge to help me.
    Thanks a lot
    Enrique Diazruanova

    ... Every time I boot up my iMac, two things happen, the first is that I programed the "System Preferences" window to open automatically and display the "Energy Saver" section on the "Sleep" sub-section, so far so good and the second thing is that no matter what I have tried to avoid it, the "Customize" window for a program named "Butler" opens also ...
    From your initial post, it appears that you have the Butler application running and have used it to access one of the Energy Saver opptions already. I don't have that particular application or a laptop to test, but if you've gotten it to access one option it should be able to access another one.

  • Need a click and drag script for multiple layers.

    Hi. I'm realitivly new to Flash and Action Script.
    For a Majour project school asignment i am trying to create an interactive map for a hypothetical theme park, and i'll cut to the chase, i need a script that allows the player to drag the content of two or three layers around the screen upon mouse click, similar to this example:\
    http://www.dreamworld.com.au/content/drw_2008_shopping.asp?name=ParkMap
    I will have a layer for buttons (probably called Buttons) and a layer for the map graphic (Probably called Map), similar to this tutorial:
    http://www.republicofcode.com/tutorials/flash/interactive_map/
    If anyone could produce, or has a script lying around that could do this; i would really apreciate it.
    This assignment has a large impact on my UAI (universities admission index).
    Thanks for your time,
    Pat

    Thanks for your help. I really appreciate it.
    The problem is; this is the script i am using to make the map interactive:
    import mx.transitions.Tween;
    import mx.transitions.easing.*;
    var cities:Array = ["muscat", "sohar", "dubai","abu_dhabi"]
    function mover (targetX, targetY){
    currentX = marker_mc._x;
    currentY = marker_mc._y;
    var xTween:Tween = new Tween(marker_mc, "_x", Strong.easeOut, currentX, targetX, .5, true);
    var yTween:Tween = new Tween(marker_mc, "_y", Back.easeOut, currentY, targetY, 1.5, true);
    for (var i = 0; i<cities.length; i++){
    var my_btn = this[cities[i]+"_btn"];
    my_btn.myCity = cities[i];
    my_btn.onRollOver = function() {
    mover( this._x, this._y);
    marker_mc.gotoAndStop(this.myCity);
    And when the buttons are made to be part of a movie clip with the image i am using for the background this script does not work.
    The script is located in a layer called "Actions", if that is of any help at all.
    Any ideas?
    I am sorry if I am being a newsense.
    Thanks

Maybe you are looking for

  • To print the headings in report based on coloumn for every page

    Hi In multi layout report ,i am getting the data with headings at first page only. But my requirement is like below: ·     Report Header details applied to every new page of the generated report. A new page is indicated by each change in (<coloumn na

  • Wireless Notebook using WRT54G V.6

    My question is if I currently have one desktop and a laptop with wireless built in and have been able to access my network through the laptop by going to "View available Networks" and just always connecting to my network when I access the internet; i

  • Cannot login into Alert Configuration (RWB)

    I have tryed to use xisuper, j2ee_admin accounts and I am always getting error. Logon failed What has happened? Call of URL http://xiserver:8000/sap/bc/bsp/sap/alertinbox/index.htm terminated due to error in logon data. Which user could login into Al

  • Defining class on the fly

    Hi, Is it possible to have a java program read in a new class from a text file while the program is running and then compile that class file and use it? thanks

  • HT4718 Will I lose my data if I restore OS X mountain lion?

    my iMac will not start and various post suggest restoring OS X mountain lion. What will happen to my date?