EEM Script to Automate DHCP/NAT changes on WAN address

Hi all,
I'm new to eem scrpting.
I need to know if it's possible to write a simple script on a DHCP cilent used for a backup in a Call center.
If power is lost or a connection it lost to the WAN interface the address will change from time to time. It does happen.
I have a bunch of static nat and port forwarding statements that don't work after the address change.
Is there a way to tell the router "consider all of the subnet possible addresses in a /192 subnet situation" ?
Then translate all nat statements to the new WAN address?
Thanks
I'm not sure if I'm asking the right question yet but that is close.
Back up router is a DHCP client and changes addresses from time to time. The router is a 3825 running 12.3 adventerprise image.
It''s not going to be updated past that.
Thanks again
evan

Thanks Joseph,
I guess I can't do it in any case because of the IOS ver. it's actually 12.3 (11).
We have a lot of static port forwarding going on. I not sure how it's going to work when the WAN address changes.
I was looking for a way to keep all of the one to one static nat statements working to the inside servers. Eventually they have to get a static ip address for the backup.
Thanks again.
evan
p.s. how would one do it if we get the updated ios ver. I see problems coming if I don't take some proactive measure.
Someway to monitor the WAN address change and keep the port fowarding exactly the same and maybe notify someone that it did change as it's a DHCP client?

Similar Messages

  • HT3477 I am attempting to set up a guest network. When I change the Network settings to DHCP NAT I get a message that tells me that the service has a private IP address and so I must connect using off bridge mode. In this mode I can not connect to the int

    I am attempting to set up a guest network on the Airport Extreme Base Station. The Base Station is connected to a DSL Modem. The network is also extended using an Airport Express. When I have attempted to set up the Base Station using DHCP NAT in the netword feature I get a message that because the service has a private IP address the only way that I can connect is in Off Bridge Mode. In this mode I do not seem to be able to connect to the internet using the guest network. Any suggestions would be helpful.

    Ok, your Speedport is actually a combination DSL modem and wireless router. In this case you would typically configure a downstream router, like your AirPort Extreme in Bridge mode. Unfortunately, when in Bridge mode, the AirPort does NOT support providing a guest network.
    The only possible option is to reconfigure the Speedport as a bridge and use the Extreme as your Internet router. You would still need the DSL modem provided by the Speedport for Internet connectivity.

  • WAN port without DHCP/NAT on WRTP54G

    (Sorry if this issue was already discussed - I couldn't find it using Advanced Search) I find that my new WRTP54G works fine, supporting VoIP and several PC clients via its LAN switch, providing I enable its DHCP and NAT function. This is with the DSL modem connected to the WRTP54G's WAN port, as required for the VoIP module to access the internet. However, this configuration (the factory default) results in "double NAT" when used with my DSL modem. (This situation is evident by inspecting the HTML status screens of the respective equipments.) The obvious solution would be simply to disable DHCP and NAT in the WRTP54G and let the DSL modem do the hard work. However, disabling DHCP/NAT within the WRTP54G essentially shuts down all PC client access to the internet. The symptoms resemble a situation where packets are not being properly routed between the WRTP54G's LAN switch side and its WAN port (although I don't know whether that is the precise cause or not). On my previous WRT54G router used with a PAP2T, I saw the same behavior but the workaround was simple: move the DSL modem Ethernet port connection from the WRT54G WAN port to one of its LAN switch ports. Problem solved at the expense of occupying one of the four available LAN switch ports. Such workaround is not applicable to the WRTP54G due to the previously mentioned requirement of its VoIP module. Has anyone got their WRTP54G (or for that matter, WRT54G) working properly with its WAN port as a simple (non-DHCP/NAT) router? Please note my preferred Internet Connection Type (on the WRTP54G opening Setup page) is "Obtain an IP automatically" although a solution using "Static IP" would be OK. I am looking for a portable solution (for hotel rooms etc.), so I can't set the WRTP54G to "PPPoE" as suggested in some other forums. Thanks in advance for any help!

    Use the Modem connected to WAN Port of the wireless router ....
    In such case you can use the DHCP of the router also & other computers using the client services can work .....
    Make sure that the Ip address should not conflict between the Vonage router & Linksys router .....
    I think that Vonage is giving Ip - 192.168.15.1 ...& the default Ip for Linksys router is 192.168.15.1 ..... change the Ip for any of the router or modem to 192.168.20.1 .....
    Also under Linksys router once you open the setup page ....
    Leave the Internet Connection type to "Obtain an Ip automatically"
    Click "MAC address clone"
    Click enable & click clone
    Click save settings ....
    See if you are able to go online or not ....

  • First EEM script

                       Hi-  Please help out this newbie...
    I am looking for an example EEM script/applet that would cause my router to change a path selection, based on a triggered event.  I usually employ Policy Based Routing on my networks which makes next hop decisions based on the source IP.  I want to do something similar with EEM, but rather than a simple source address based decision, I want a next hop selection to be based on an event.  (for the example, it could be anything...bandwidth threshold, or at a certain time of day, or whatever).  First I want to know if this can be done, and second I would appreciate it if someone could share a simple example configuration with me.   -it's the best way I learn it.
    Also, in the example, how is the applet or script applied to the router?
    Thanks!     

    You can adjust routes or add class-maps based on EEM events.  However, you can't match on something that can be controlled by an EEM event (i.e., match within a route-map).  However, you can create a route-map on the fly when an event occurs.  That is, when your event occurs, you can define a route-map to match on the interesting traffic and adjust the IP next-hop.  Bottom line is if you can do something manually on the CLI, you can automate it with EEM.
    Without knowing more specifics, I'll provide an example that will allow you to run CLI at a specific time (at midnight).  You can adapt this to meet your specific needs.  This applet can be copy and pasted directly into config t mode:
    event manager applet timed-cli
    event timer cron cron-entry "0 0 * * *"
    action 1.0 cli command "enable"
    action 2.0 cli command "config t"
    action 3.0 cli command "route-map TEST"
    action 4.0 cli command "match interface gi0/0"
    action 5.0 cli command "set ip next-hop 10.1.1.1"
    action 6.0 cli command "end"

  • Script for change IP static address using Powershell

    Hi...
    I have a question: I regularly connect me to two different network segments, I want to know how to create a script to map to the network adapter an IP static, in this way could run the corresponding script when I find in each segment of the network using
    powershell... the DHCP  not permitt in company, is for that reason that I need a way to automate the allocation of IP address static in my network adapter, in this way could change the IP address depending on the network segment that I find.
    I hope your comments..
    Thanks

    Start by looking here:
    http://gallery.technet.microsoft.com/site/search?f%5B0%5D.Type=RootCategory&f%5B0%5D.Value=networking&f%5B0%5D.Text=Networking&f%5B1%5D.Type=SubCategory&f%5B1%5D.Value=clientside&f%5B1%5D.Text=Client-Side%20Management
    ¯\_(ツ)_/¯

  • Eem script monitor routing table - multiple entries into 1 email

    I have the following script running to report on routing table changes
    event manager applet route-table-monitor
    event routing network 0.0.0.0/0 ge 1
    action 0.5 set msg "Route changed: Type: $_routing_type, Network: $_routing_network, Mask/Prefix: $_routing_mask, Protocol: $_routing_protocol, GW: $_routing_lastgateway, Intf: $_routing_lastinterface"
    action 1.0 syslog msg "$msg"
    action 2.0 cli command "enable"
    action 4.0 info type routername
    action 5.0 mail server "10.*.*.*" to "roger.perkin@****" from "Switch1" subject "Routing Table Change" body "$msg  $_cli_result"
    It works perfectly however if multiple routes change I get multiple emails.
    Last night we had a site go out and I got about 20 separate email for each subnet change.
    What I would like to do is get this script to take all routes changed in a 1 minute interval and then output them into an email.
    Not quite sure how I would go about that?
    Thanks
    Roger
    Currently studying for my CCIE and just started on EEM, have not done much scripting before so this is all good stuff to know.

    You can't do this with one policy.  However, you could accomplish this with a timer policy that will batch up the pending updates, though.  Something like this would work.
    event manager applet route-table-monitor event routing network 0.0.0.0/0 ge 1 action 0.5 set msg "Route changed: Type: $_routing_type, Network:  $_routing_network, Mask/Prefix: $_routing_mask, Protocol:  $_routing_protocol, GW: $_routing_lastgateway, Intf:  $_routing_lastinterface" action 0.6 syslog msg "$msg" action 1.0 handle-error type ignore action 2.0 context retrieve key RTRCTXT variable msgs action 3.0 if $_error ne FH_EOK action 4.0  set msgs "$msg\n" action 5.0 else action 6.0  append msgs "$msg\n" action 7.0 end action 8.0 handle-error type exit action 9.0 context save key RTRCTXT variable msgs!event manager applet route-table-batcher event timer watchdog time 60 action 1.0 handle-error type ignore action 2.0 context retrieve key RTRCTXT variable msgs action 3.0 if $_error eq FH_EOK action 4.0  info type routername action 5.0  mail server "10.*.*.*" to "roger.perkin@****" from "$_info_routername" subject "Routing Table Change" body "$msgs" action 6.0 end action 7.0 handle-error type exit

  • Is there a possibility to change the email address of  email alarms automatically in Calendar?

    Hi,
    In the Calendar app, I have a lot of events related to bussiness and I set an email alarm in each of them. But now I want to change the email address of the alarm in order to send the events to someone else. The problem is that because the number of the events is really big, I was wondering whether there was a way to change the address in all the events automatically. Is there such a possibility? Thank you in advance.

    My opinion: I think you'll need to define what, to you, means "primary user".  a primary user relationship can be defined manually by you one by one in the console, automatically by usage, imported via script, or the end user (if they know
    how and you've allowed this in settings) can indicate a machine is a primary machine for themselves.
    How is primary user relationship set, in your environment?  Depending upon how that relationship is determined in your environment, then you can track for that particular machine how or why the relationship you expect to be there, isn't the relationship
    the database acknowledges.
    Standardize. Simplify. Automate.

  • Script to automate the display language on windows server

    Hi,
    I'm looking for a script which should change the windows display language from non-english to english (vizversa).
    Here is the scenario:
    On windows server 2008 R2 I have two language installed - Japanese and English with the help of MUI packs available on microsoft site. The native language of windows server 2008 R2 is Japanese. Consider there are 10 sys admins only knows
    Japanese but not english. Similarly there are 10 sys admins knowing only English. I  being english administrator, i should each time go to regional setting in the control panel and click on change display language to english. After
    I finish my task I need to set back the language to japanese(native).
    I'm looking for script which can auotmate this process.
    Objective:
    The script should automatical change the language to Japanese when I logoff from the system. 
    Here is the steps to reach "Change Display language" on windows server 2008
    Go to control Panel > Category view (on right side top ) > System and Security > Clock ,Language and Region > Under “Regional Language” > Change display
    language > Go to Tab “Keyboards and Languages” > Look for the dropdown menu “Choose a display language” and choose the appropriate language you prefer from the dropdown list
    Kindly note this menu/option is available for Vista,Windows 7 and Windows Server 2008. This option is also available on Windows XP/Server 2000/2003 provided the LIP/MUI is installed.
    Thanks
    Ezakial

    Hi,
    I'm looking for a script which should change the windows display language from non-english to english (vizversa).
    Here is the scenario:
    On windows server 2008 R2 I have two language installed - Japanese and English...
    Thanks
    Ezakial
    Guys,
    Forgive me, but I think you are making this far too complicated. Using a script to achieve this is, in my view the wrong tool, and a little dangerous. If your logoff script fails to run for any reason, 11 Japanese sysadmins will be waving Samurai swords
    at you :-).
    There is a single Group Policy setting that will do exactly what you want on Vista, W7, W2K8 & R2.
    Create a new Group Policy object ("English_interface", for example.
    Edit the new policy object
    Drill down to "User Configuration, Policies, Administrative Templates, Control Panel, Regional and Language Options"
    Pick the setting "Restricts the UI languages Windows should use for the selected user" and Enable it.
    Drop down the "Restrict users to the following language" and pick "English"
    Click "OK"
    Link your new GPO somewhere in the OU hierarchy that contains the English user
    If other (Japanese?) users are also in the same container, you can filter application of the GPO by security group so that the policy can only be read and applied by the English group.
    That's all you need to do!
    As a point of principle. I ALWAYS install my OS in US English then add languages, and set the locals to use their own language. This is because service packs and hotfixes invariably arrive for US English first, and some hot fixes are NEVER translated.
    I'm just doing this for a single W7 build in English, to be deployed in 6 countries, with 7 different languages and 9 different keyboard layouts. Fun...
    Come back if you need more help. I volunteer to visit and help if you want!
    Richard
    MCSE, MCITP, MCT etc.
    Switzerland
    RS

  • Bridge/DHCP/NAT ?

    Bear with me here please. I finally got rid of my vonage to switch to maic jack. my vonage was connected between the road runner runner modem and my time capsule/airport. my timecapsule/ airport setting was at " bridge". I lost my wifi function when i hooked the time capsule straight to the road runner until i changed "Bridge" to DHCP/NAT.  did I do right" what is DHCP and NAT? should i have chosen just DHCP?
    Thank you so much appreciate your help.

    DHCP lease is the time the device will wait until the leased IP is expired and a new one is needed.. actually it is programmed to begin requests for a new IP at half the lease time.. so 12hours.. This is stock standard.. nothing wrong.
    also under airport utility> wireless security , it says none !!! what do you think?
    This needs fixing NOW.. I mean Arnie type NOW.. DO IT ... DO IT NOW!!
    http://www.youtube.com/watch?v=lOoOP2l_ahQ
    Your wireless is open to all the world.. bad.. wrong.. everybody in the district will be using your network.
    Put the security to WPA2 Personal and type in a password.. combo of upper and lower case and numbers... no dictionary words.. 10-20 characters should be enough.

  • 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

  • Cisco 1841/871 crash EEM scripting 15.1(1)T

    We have been testing 15.1.1T on a couple of lab Cisco 1841 and Cisco 871 devices.
    On the devices we are using EEM to automate the failover/failback process for a cellular modem attached to f3 on the 871 or f0/1 on the 1841. One of the EEM applets we use fires from a cron timer event that occurs every 10 minutes on the router.
    IOS revision 12.4(22)T we had no problems with using the cron-timer triggered applet (every 10 minutes between 7am to 10pm), except for the fact that every command issued by EEM required AAA authentication. The EEM applet is causing our routers to saturate our Cisco ACS servers (we use 700+ routers in the field, all exectuing this EEM script) with single-connect requests. We will refer to the cron-timer executed applet as 'Maintenance' from here on out.
    As of 15.1(1)T the addition to bypass the AAA authentication process became available. This was a huge speed increase to our EEM applets, specifically the Maintenance applet. I will include the applet for clairity.
    event manager applet Maintenance authorization bypass
    event timer cron name 10min cron-entry "*/10 7-21 * * *" maxrun 30
    action 001 cli command "en"
    action 002 cli command "show ip route | section B\*[ ]+0\.0\.0\.0"
    action 003 regexp "^B\*.([ ]+)(0\.)+0" "$_cli_result"
    action 004 set bgpstate "$_regexp_result"
    action 005 cli command "show ip route | section S[ ]+208\.38\.154\.8"
    action 006 regexp "^S([ ]+)208\.38\.154\.8" "$_cli_result"
    action 007 set wireless "$_regexp_result"
    action 008 track read 1
    action 009 set track1 "$_track_state"
    action 010 if $wireless eq 0
    action 011       if $bgpstate eq 0
    action 012             cli command "conf t"
    action 013             cli command "int fa0/1"
    action 014             cli command "no shut"
    action 015             cli command "int tun201"
    action 016             cli command "no shut"
    action 017             cli command "int lo201"
    action 018             cli command "no shut"
    action 019             if $track1 eq up
    action 020                   exit
    action 021                   else
    action 022                   cli command "conf t"
    action 023                   cli command "int s0/0/0"
    action 024                   cli command "no shut"
    action 025             end
    action 026             cli command "end"
    action 027             cli command "exit"
    action 028       else
    action 029             exit
    action 030            end
    action 031 else
    action 032       if $bgpstate eq 1
    action 033             cli command "conf t"
    action 034             cli command "int fa0/1"
    action 035             cli command "shut"
    action 036             cli command "int tun201"
    action 037             cli command "shut"
    action 038             cli command "int lo201"
    action 039             cli command "shut"
    action 040             cli command "end"
    action 041             cli command "exit"
    action 042      else
    action 043             if $track1 eq up
    action 044                   exit
    action 045             else
    action 046                   cli command "conf t"
    action 047                   cli command "int s0/0/0"
    action 048                   cli command "no shut"
    action 049             end
    action 050             cli command "end"
    action 051             cli command "exit"
    action 052             exit
    action 053       end
    action 054 end
    This script is designed to look for a couple of routes in the IP routing table, and populate two variables (bgpstate and wireless) with the regular expression matching result of the show ip route commands. It uses track 1 to determine the up/down status of Serial0/0/0 which is the primary T1 interface for WAN services on the router. The wireless is "up/1" if the static route to 208.38.154.8 is present in the show ip route output (only when f0/1 is up in this case). The T1 is "up/1" if the default route passed to the IP routing table is present in the show ip route output.
    Before the upgrade to 15.1(1)T these scripts ran without issue, and we had no errors. Now after the upgrade, anytime this script fires and the show ip route match for the wireless variable is 1 instead of zero, it begins to run through the else condition starting at action 031, and during the second execution of the script every 10 minutes (I still have not figured out how to force the cron-timer to fire only ONCE per minute, instead of at the beginning and end of the minute), the router will generate spurious memory errors, and sometimes crash or reboot.
    This all began with 15.1(1)T, and I have not seen any caveats or other entries that could possibly point to the cause of this problem. Any ideas?
    I am also attaching a crash file from one of the routers like this one so you can see what I mean.
    All of these devices are running the advipservices k9 version of this IOS.
    Thanks for your time.

    The problem with cron events running twice in the same minute is bug CSCsz12460 which will be fixed in EEM 3.2 in 15.1(3)T.
    The crash you're seeing doesn't appear to be related to EEM at all.  It looks like a problem with single-connection TACACS+.  The bug appears to be CSCtg40901 which has not yet been fixed in 15.1T.
    A workaround was suggested to use multiple-connection TACACS+.

  • EEM Scripts on a Catalyst 3750G

    Does anyone know if I can run EEM scripts on a Catalyst 3750G switch? If so, what version of IOS do I need to make it work?
    Thanks!    

    Joseph,
    I want to create a simple EEM script on a Catalyst 3750G running ipservices IOS on it. All I want to do is monitor interfaces GigabitEthernet 1/0/3 and GigabitEthernet 1/0/4. If either of these interfaces go down, I wan the EEM script to shutdown interface GigabitEthernet 1/0/26. Here is what I put together so far. I haven't tried it yet, but do you think this will work?
    Thanks!
    event manager session cli username "root"
    event manager applet Stop_Announcing_BGP
    event syslog pattern "Interface GigabitEthernet1/0/3, changed state to down"
    event syslog pattern "Interface GigabitEthernet1/0/4, changed state to down"
    action 1.0 cli command "enable"
    action 1.1 cli command "configure terminal"
    action 1.2 cli command "interface gig1/0/26"
    action 1.3 cli command "shut"

  • Is there a script to automate NBAR Protocal pack download from CCO

    is there a script to automate NBAR Protocal pack download from CCO ?

    I do not know of one.  It may be challenging to build one, too.  While there is an HTTP API built into EEM Tcl, it supports HTTP only.  I believe accessing the NBAR protocol packs would require HTTPS?  If it can be done with a clear text protocol like HTTP or FTP, we could build a script to automate the process.

  • [SOLVED] Script to automatically update source

    Hello,i need a script to use in a pkgbuild that can
    1)check this website http://fsinapsi.altervista.org/code/tre … 091228.zip for new version of the archive.
    2)change the pkgver if a new version is found
    3)download the archive
    Maybe it's something like this (taken from the chromium pkgbuild),but i don't know how i can modify it .. thank you.
    _bldname=chrome-linux.zip
    _bldroot=http://build.chromium.org/buildbot/snapshots/${_bldarch}
    source=('LICENSE.txt' 'chrome-wrapper.patch' "${_realname}.1.gz" "${_realname}.default"
    "${_realname}.desktop" "${_realname}.sh")
    noextract=(${_realname}.1.gz)
    # trick re-determining the build revision and, or entertain the hidden
    # makepkg option --forcever, huh
    if [ -z "$FORCE_VER" ]; then
    msg "Determining latest build revision..."
    newpkgver="$(wget -qO - ${_bldroot}/LATEST)"
    if [ -n "$newpkgver" -a "$newpkgver" != "$pkgver" ]; then
    msg2 "Version found: %s" "$newpkgver"
    FORCE_VER="$newpkgver"
    else
    FORCE_VER="$pkgver"
    fi
    fi
    if [ "$FORCE_VER" = "LATEST" -a "$SOURCEONLY" -eq 0 ]; then
    error "Plz omit '--forcever LATEST'; I'll auto-detect the LATEST ;)"
    exit 1
    elif [ "$FORCE_VER" != "$pkgver" ]; then
    rm -f "$SRCDEST/${_bldname}"
    devel_update
    fi
    build() {
    if [ ! -r "$srcdir/${_bldname}" ]; then
    msg2 "Downloading the latest '$CARCH/$pkgver/${_bldname}'..."
    wget --no-cache -c "${_bldroot}/$pkgver/${_bldname}" \
    -O "$SRCDEST/${_bldname}" || return $?
    ln -fs "$SRCDEST/${_bldname}" "$srcdir/${_bldname}" || return $?
    fi
    Last edited by Xemertix (2010-01-01 18:30:04)

    Xemertix wrote:
    tomk wrote:This is PKGBUILD abuse IMO.
    Yes i know,but this archive is updated frequently and generally there aren't major changes in the new versions,so a pkgbuild with a similar script may work well for some time...
    So would an external script which automatically updates the PKGBUILD on your machine and then uploads it to the AUR? Simplest I can think of would involve bash, wget/curl, and a bit of sed.
    You could even run every X hours if you feel like it.

  • EEM script to monitor OSPF neighbor not working

    I'm trying to monitor a OSPF neighbor syslog notification event to trigger actions to remove a network statement.  I shut down the interface to the monitored neighbor and it removes the network statement which is good.  I am also trying to monitor the neighbor to come back up and then re add the removed network statement which is not working.  This may be a two part problem but I am receiving warnings that not enough vty lines are available.  I am not seeing that the network addition is working at all.  Here is my configuration.
    event manager applet ospf-watch-down
    event syslog pattern "OSPF-5-ADJCHG: Process 100, Nbr 1.1.1.2 on FastEthernet1/0 from FULL to DOWN"
    action 1.0 cli command "enable"
    action 2.0 cli command "config t"
    action 3.0 cli command "router ospf 100"
    action 4.0 cli command "no network 2.2.2.0 0.0.0.255 area 0"
    action 5.0 cli command "end"
    action 6.0 cli command "exit"
    event manager applet ospf-watch-up
    event syslog pattern "OSPF-5-ADJCHG: Process 100, Nbr 1.1.1.1 on FastEthernet1/0 from LOADING to FULL"
    action 1.0 cli command "enable"
    action 2.0 cli command "config t"
    action 3.0 cli command "router ospf 100"
    action 4.0 cli command "network 2.2.2.0 0.0.0.255 area 0"
    action 5.0 cli command "end"
    action 6.0 cli command "exit"
    Here is the EM syslog error message " %HA_EM-3-FMPD_ERROR: Error executing applet ospf-watch-down statement 3.0"  I am having the EM end and exit so I'm not sure why it's running out of CLI sessions.  I'm also getting this one too " %HA_EM-3-FMPD_CLI_CONNECT: Unable to establish CLI session: no tty lines available, minimum of 2 required by EEM"
    I've tested the ospf-watch-up and ospf-watch-down on its own after clearing all of the sessions and they each work on their own.  I think this is a bug where eem won't release the session.
    R1#show users
        Line       User       Host(s)              Idle       Location
    *  0 con 0                idle                 00:00:00
     130 vty 0                idle                 00:02:13 EEM:ospf-watch-up
     131 vty 1                idle                 00:00:10 EEM:ospf-watch-up
     132 vty 2                idle                 00:00:28 EEM:ospf-watch-down
      Interface    User               Mode         Idle     Peer Address
    R1#

    I know this is a old post. I was able to use the solution below, but I am having one problem.
    Using the below config I am able to receive a email anytime my voice port is in any other state than ON HOOK. The problem I have is the script runs every 30 seconds and I receive an email every 30 seconds the line is in any other state than "ON-HOOK". 
    Is there a way to have only one email generated ONLY when the state changes from the previous state? 
    example : the line is on-hook, changes to off-hook or park or whatever- a email would be generated.  ( only One email). not one every 30 seconds...
                   The line goes from Off-Hook back to IDLE.  - A email would be generated to advise the line has been restored to a IDLE state. 
    scheduler allocate 20000 1000
    event manager environment _email_from [email protected]
    event manager environment _email_to email [email protected]
    event manager environment _email_server smtp-server.isp.net
    event manager applet check_1/0/0_if_NOT_ONHOOK
     event timer watchdog time 30
     action 001 cli command "enable"
     action 002 cli command "show voice port summ | include 1/0/0"
     action 003 foreach line "$_cli_result" "\n"
     action 004  regexp "on-hook" "$line"
     action 005  if $_regexp_result eq "1"
     action 006   exit 0
     action 007  end
     action 008 end
     action 009 syslog msg "PORT_1_is_in_any_other_state_then_on-HooK!"
     action 1.0 mail server "$_email_server" to "$_email_to" from "$_email_from" subject "$_event_pub_time:Test EEM port 1/0/0 is SHORTED ie IN ALARM" body "TEST Body"
    end
    Any ideas?

Maybe you are looking for

  • Can I Install On A Different Computer?

    I have OS X Server 10.4 on a Mac mini running as a web and email server in a remote data centre about 100 miles away. I want to add a FW external HD with a fresh installation of OS X Server that I will copy (Carbon Copy Cloner or SuperDuper) on the b

  • Error while retreiving data from oracle using EJB.

    HII All, I m getting this error while trying to retreive data from oracle DB using EJB. An error has occurred. Maybe the request is not accepted by the server: Exception in method empName. HTTP/1.1 500 Internal Server Error Connection: close Server:

  • Hai i am new to the abap,help me in this problem,i am not getting the o/p.

    tables:mara. data:begin of itab occurs 0,        matnr like mara-matnr,        mbrsh like mara-mbrsh,       mtart like mara-mtart,       meins like mara-meins,      end of itab. select-options:s_matnr for mara-matnr no extension. select matnr        

  • Regarding error in xml validation 7.1

    Hi I am doing file to idoc scenario. In the sender agreement i selected validation by Adapter and uploaded the particular xsd.after executing the scenario in runtime workbench it is showing sucessfully processed  but in the MDT audit log I am getting

  • Resource search, only 1 resource displayed

    When i enter a new role in cProjects with qualifications and i use the resource finder (via the: find resource button) i only get 1 result... while i know that there are at least 20 people with availability and the required qualification. What can i