How to shut no shut interface of switch using(EEM) Script for 3560 switch

Dear community experts,
I'm new for creating scripting for EEM and below is my situation, need your support.
Present I'm using 3560 switch, one of  the switch port(FA0/1) has added  Cisco Access point(PoE), actually what happening daily this Access point getting struct when I'M doing the switch port (FA0/1) shut  then no shut it is working fine .
So my question is i need script, that should continuously ping the IP off the Access point if the IP will drop 4 packets the switch do shut  and then no shut for that I need the script, Please help me.
if it is not possible please provide the batch file, which will ping the particular IP if 4 packet drops it will telnet the switch and go to the interface do shut no shut 
Note: 
instead of mentioned 3560, I mentioned 2960 now corrected it  please provide the script.

This should work:
ip sla 1
 icmp-echo 10.10.10.1
 frequency 15
ip sla schedule 1 life forever start now
ip sla enable reaction-alerts
ip sla reaction-configuration 1 react timeout action-type trapOnly threshold-type consecutive 4
event manager applet reset-ap
 event ipsla operation-id 1 reaction-type timeout
 action 1.0 cli command "enable"
 action 2.0 cli command "config t"
 action 3.0 cli command "int fa0/1"
 action 4.0 cli command "shut"
 action 5.0 cli command "no shut"
 action 6.0 cli command "end"

Similar Messages

  • HT204053 How does my spouse get the benefits of using my iCloud for contacts and calanders but not messages, etc?

    How does my spouse get the benefits of using my iCloud for contacts and calanders but not messages, etc?

    iCloud is designed for personal use and not for managing multiple access.  If you gives your password to someone else, this person can benefit everything including access to purchase with your account, email, etc.
    You should rather consider having each one an iCloud account and then, create and share a calendar.  As for contact, you can send them to your spouse to be save in her account but they cannot be shared nor synced.

  • Using command tab for application switcher no long cycles through all apps

    Using command tab for application switcher use to work as it always has before Lion, and did in Lion for a few days. Now it stops at the last app. It always use to keep cycling through through all the apps. I figure I did something, but cannot figure out what. I have tried old tricks like force quitting dock using Activity Monitor, but that didnt work. Tried restarting, repairing permissions, and a new user account. I will great appreciate anyones help with this.
    Thanks,
    Mark C.

    I was going to post my experience about application switcher as well, but i have the opposite problem: in SL it never worked, but now in Lion it does. Since I upgraded by installing over Lion, I'm assuming there must be a setting somewhere for this behavior. There is a place for setting keyboard keystrokes, looking there may help.

  • Need SNMP oid or object name to monitor temperature for 3560 switch.

    hi all
    i have 3560 switch loacted in warehouse environments . i need to monitor the temperatue of this switch . i am looking for OID value  that serves this purpose
    kindly provide me how to look for all OID that give me real time  status for FAN .. CPU UTILISATION ...TEMPERATURE ...OR ANY MAJOR EVENT THAT CAN DISRUPT MY PRODUCTIN ..
    THANKS 

    The CISCO-ENVMON-MIB is a good one to look at for these types of queries:
    http://tools.cisco.com/Support/SNMP/do/BrowseMIB.do?local=en&step=2&submitClicked=true&mibName=CISCO-ENVMON-MIB#contents
    Have a look at  ciscoEnvMonTemperatureStatusValue for temperature.
    For CPU utilization:
    CISCO-PROCESS-MIB
    Memory
    CISCO-MEMORY-POOL-MIB

  • How to get ORA errors in alertlog file using shell script.

    Hi,
    Can anyone tell me how to get all ORA errors between two particular times in an alertlog file using shell script.
    Thanks

    Hi,
    You can define the alert log as an external table, and extract messages with SQL, very cool:
    http://www.dba-oracle.com/t_oracle_alert_log_sql_external_tables.htm
    If you want to write a shell script to scan the alert log, see here:
    http://www.rampant-books.com/book_2007_1_shell_scripting.htm
    #!/bin/ksh
    # log monitoring script
    # report all errors (and specific warnings) in the alert log
    # which have occurred since the date
    # and time in last_alerttime_$ORACLE_SID.txt
    # parameters:
    # 1) ORACLE_SID
    # 2) optional alert exclusion file [default = alert_logmon.excl]
    # exclude file format:
    # error_number error_number
    # error_number ...
    # i.e. a string of numbers with the ORA- and any leading zeroes that appear
    # e.g. (NB the examples are NOT normally excluded)
    # ORA-07552 ORA-08006 ORA-12819
    # ORA-01555 ORA-07553
    BASEDIR=$(dirname $0)
    if [ $# -lt 1 ]; then
    echo "usage: $(basename) ORACLE_SID [exclude file]"
    exit -1
    fi
    export ORACLE_SID=$1
    if [ ! -z "$2" ]; then
    EXCLFILE=$2
    else
    EXCLFILE=$BASEDIR/alert_logmon.excl
    fi
    LASTALERT=$BASEDIR/last_alerttime_$ORACLE_SID.txt
    if [ ! -f $EXCLFILE ]; then
    echo "alert exclusion ($EXCLFILE) file not found!"
    exit -1
    fi
    # establish alert file location
    export ORAENV_ASK=NO
    export PATH=$PATH:/usr/local/bin
    . oraenv
    DPATH=`sqlplus -s "/ as sysdba" <<!EOF
    set pages 0
    set lines 160
    set verify off
    set feedback off
    select replace(value,'?','$ORACLE_HOME')
    from v\\\$parameter
    where name = 'background_dump_dest';
    !EOF
    `
    if [ ! -d "$DPATH" ]; then
    echo "Script Error - bdump path found as $DPATH"
    exit -1
    fi
    ALOG=${DPATH}/alert_${ORACLE_SID}.log
    # now create awk file
    cat > $BASEDIR/awkfile.awk<<!EOF
    BEGIN {
    # first get excluded error list
    excldata="";
    while (getline < "$EXCLFILE" > 0)
    { excldata=excldata " " \$0; }
    print excldata
    # get time of last error
    if (getline < "$LASTALERT" < 1)
    { olddate = "00000000 00:00:00" }
    else
    { olddate=\$0; }
    errct = 0; errfound = 0;
    { if ( \$0 ~ /Sun/ || /Mon/ || /Tue/ || /Wed/ || /Thu/ || /Fri/ || /Sat/ )
    { if (dtconv(\$3, \$2, \$5, \$4) <= olddate)
    { # get next record from file
    next; # get next record from file
    # here we are now processing errors
    OLDLINE=\$0; # store date, possibly of error, or else to be discarded
    while (getline > 0)
    { if (\$0 ~ /Sun/ || /Mon/ || /Tue/ || /Wed/ || /Thu/ || /Fri/ || /Sat/ )
    { if (errfound > 0)
    { printf ("%s<BR>",OLDLINE); }
    OLDLINE = \$0; # no error, clear and start again
    errfound = 0;
    # save the date for next run
    olddate = dtconv(\$3, \$2, \$5, \$4);
    continue;
    OLDLINE = sprintf("%s<BR>%s",OLDLINE,\$0);
    if ( \$0 ~ /ORA-/ || /[Ff]uzzy/ )
    { # extract the error
    errloc=index(\$0,"ORA-")
    if (errloc > 0)
    { oraerr=substr(\$0,errloc);
    if (index(oraerr,":") < 1)
    { oraloc2=index(oraerr," ") }
    else
    { oraloc2=index(oraerr,":") }
    oraloc2=oraloc2-1;
    oraerr=substr(oraerr,1,oraloc2);
    if (index(excldata,oraerr) < 1)
    { errfound = errfound +1; }
    else # treat fuzzy as errors
    { errfound = errfound +1; }
    END {
    if (errfound > 0)
    { printf ("%s<BR>",OLDLINE); }
    print olddate > "$LASTALERT";
    function dtconv (dd, mon, yyyy, tim, sortdate) {
    mth=index("JanFebMarAprMayJunJulAugSepOctNovDec",mon);
    if (mth < 1)
    { return "00000000 00:00:00" };
    # now get month number - make to complete multiple of three and divide
    mth=(mth+2)/3;
    sortdate=sprintf("%04d%02d%02d %s",yyyy,mth,dd,tim);
    return sortdate;
    !EOF
    ERRMESS=$(nawk -f $BASEDIR/awkfile.awk $ALOG)
    ERRCT=$(echo $ERRMESS|awk 'BEGIN {RS="<BR>"} END {print NR}')
    rm $LASTALERT
    if [ $ERRCT -gt 1 ]; then
    echo "$ERRCT Errors Found \n"
    echo "$ERRMESS"|nawk 'BEGIN {FS="<BR>"}{for (i=1;NF>=i;i++) {print $i}}'
    exit 2
    fi

  • How to create Customer Group in CRM and use reminder script

    Dear Sir,
    I would like to set the group of customer in CRM , Such as , customer 1 is in Group A , Custoemr2 is in Group B.
    So, in Interaction Center : CIC0 , I will do the reminder scipte, there script for Customer Group A , anothere script for Customer Group B. How can I do that?
    Please kindly advise.
    Thanks and best regards,
    Vimol

    hi.
    define the variable using transaction code CIC2
    then assign that vaiable in text using transaction code CIC9
    then assign the text to reminder scipting using transaction code CIC1.
    If helpful reward me

  • How to add a file in Document Set using ECMA script?

    Hi,
    I want to upload a particular file into Document set using ECMA script.
    I can do it easily through C# but unable to achieve the same using ECMA Script.
    Any pointers or piece of code will be helpful.
    Thanx in advance :)
    "The Only Way To Get Smarter Is By Playing A Smarter Opponent"

    The following blog post provides a way to create a document set using ECMA:
    http://blogs.msdn.com/b/mittals/archive/2013/04/03/how-to-create-a-document-set-in-sharepoint-2013-using-javascript-client-side-object-model-jsom.aspx
    The following blog post provides a way to upload files into a document set using CSOM:
    http://www.c-sharpcorner.com/Blogs/12139/how-to-create-document-set-using-csom-in-sharepoint-2013.aspx
    See if you can follow the logic in the CSOM example to apply it to ECMA. Let me know if you have specific problems with it.
    Dimitri Ayrapetov (MCSE: SharePoint)

  • Documaker :How to dynamically move or resize a section using DAL Script?

    Hi all
         i am a newbie to Documaker. I am working with Documaker 11.4. I would like to know two things
            (1)   Whether there is any option to move a section towards left, dynamically using DAL Script.
            (2)   And is there any option to resize the section dynamically using DAL Script.
    Thanks in advance.

    This is obviously a bug with Photoshop Elements 12.
    In my Photoshop Elements 10 the printer dialogue box scales to fit the screen every time.
    In Photoshop Elements 12, even moving the task bar away (you can simply drag it up the right hand side of your screen with the mouse) you can't see the print button as its still off the bottom of the screen.
    My work around is to hold shift+alt+cntl and click on my Ps icon - Click compatibility - Scroll  down to settings - click run in 640 x 480 screen resolution. It then does horrible things to your screen res, but hey presto the printer dialogue box is minimised and you can print your picture. As with your Toshiba, even with the printer dialogue box fully exposed there are no chevrons in the bottom right hand corner to minimise the printer dialogue window and the arrow buttons simply start trying to change the settings in the printer set up. The dialogue box is still nailed to the top of the screen with no title bar to right click on.
    How do I escalate this to report it as a bug to Adobe?

  • Using EEM to telnet to switches and execute commands

    Can EEM telnet to other switches.
    It doesn't seem to work and when you run debug it drops out at the password for telnet.
    I have tried using the "pattern" option to put the telnet password in.  but can't get it to work
    All I won't to be able to do is automatically run a few commands on other switches from the core.
    Any ideas

    I can assure you EEM on IOS can initiate telnet session without a hitch, but on IOX, still struggling to find out the workaroud.
    proc remote_cmd_telnet { remote_host username password prompt_expect clist } {
        # this function will carry out each command contained in the clist on remote host.
        if { [catch {cli_open} result] } {
                 PUTS $result
                 return 1
            } else {
                 array set cliarr $result
        #Login to remote router
        if { [catch {cli_write $cliarr(fd) "telnet  $remote_host" } result] } {
             PUTS $result
             return 1
        PUTS $result
    #   if { [catch {cli_read_pattern $cliarr(fd) "Username:"} result] } {
    #        PUTS error "Failed to read response: '$result'"
    #       return 1    
    #   PUTS $result
        if { [catch {cli_write $cliarr(fd) $username } result] } {
             PUTS $result
             return 1
        PUTS $result
        if { [catch {cli_read_pattern $cliarr(fd) "Password:"} result] } {
            PUTS error "Failed to read response: '$result'"
            return 1    
        PUTS $result
        if { [catch {cli_write $cliarr(fd) $password } result] } {
             PUTS $result
             return 1
        PUTS $result
        if { [catch {cli_read_pattern $cliarr(fd) "#"} result] } {

  • How to create a strictly typed refnum control using LabVIEW scripting

    I wish to use LabVIEW scripting to create a strictly-typed refnum control that is bound to my custom control (a type-defined cluster), but I'm unfamiliar with scripting and can't see how to do it.
    If I create a New VI Object, using Control Refnum as the Style, how do I provide my custom control to the VI Object Class terminal? When I try using a reference to my custom control.ctl file (using Open VI reference) I get an error: "Error 1057 occurred... Type mismatch: Object cannot be cast to the specified type."
    Or, if I create a new Control Refnum as above, using a standard Cluster as the VI Object Class, how do I then convert this refnum control to a strictly typed refnum that is bound to my custom cluster control type?
    Thanks in advance for any advice,
    Thoric (CLA, CLED, CTD and LabVIEW Champion)
    Solved!
    Go to Solution.

    Here we go...
    You have to create a new Control VI and then specify the VI Type as Typedef.
    Regards,
    Da Helmut
    Attachments:
    example.vi ‏22 KB

  • How do I set Firefox 10.0.2 to be default browser in Windows 7, using a script or setup switch. "Firefox.exe -setDefaultBrowser" does NOT work.

    I want to set Firefox as default browser for all my users.
    I can do this by opening Firefox and go to Tools --> Options --> Advanced and hit the "Check now" button. That works fine, but I need to accomplish this automatically.
    Running setup with the -setDefaultBrowser switch does NOT work. Running "firefox.exe -silent -SetDefaultBrowser" after setup does NOT work.
    Is this even possible? Or are we stuck with IE?

    Thank you for your reply, however it really does not work for me.
    I have Firefox installed, as well as Internet Explorer 9. If I check "Default Programs --> Set Default Programs" in Windows 7 it states that Internet Explorer is default.
    If I create a shortcut on my desktop that points to "www.mozilla.org" for example, and double-click that shortcut, it will open in Internet Explorer.
    I now run "%ProgramFiles%\Mozilla Firefox\Firefox.exe -silent -setDefaultBrowser" with administrative privileges.
    I look again in "Default programs" and i still says IE is default browser. If I click on my shortcut it still opens in IE.
    If I change the setting manually from within Firefox it works fine.
    Please help, I really can't make this work.

  • Is it possible to have English as the interface language, but use (and develope for) any other language/locale?

    Before installing Firefox, I need to clarify the following:
    The use of locales: I am a developer and my preferable language, for the interface, is English (though, it is not my mother tongue). But, I would like to be able to use any other language (including, the use of any dictionary) and develop for any language or locale. So, does the English version let me do the above mentioned?
    Or, eg, do I need to install the Hebrew locale, if I want to use the Hebrew dictionary?
    Or, is it possible to install different locales on the same computer (and for the same user, in Win XP)?

    You can install any dictionary is every locale, so that shouldn't be a problem if you use the English locale.
    If you want to check out the user interface or how the browser acts with an RTL locale like Hebrew then you need to install the language pack and switch to that locale.
    You can install additional language packs in any Firefox version.
    * http://kb.mozillazine.org/Language_packs
    * Locale Switcher: https://addons.mozilla.org/firefox/addon/locale-switcher/
    * http://releases.mozilla.org/pub/mozilla.org/firefox/releases/latest/win32/xpi/

  • How to capture an image and save it using action script

    Hello,
    I need to know if is posible to capture an image or a screen region and save it using action scrip.
    Somebody know how to do it ??
    Thanks

    you can capture an image using the bitmapdata class and getPixel().  you can then save that to a bitmap using server-side code like php.

  • How to Compile the PL/SQL Package/ Procedure using shell script

    Hi,
    I tried to Compiled the shell script but I am facing some error.
    Can any one help me how to compile the PL/SQL shell script without error. Awaiting for your valuable reply.
    Thanks,
    Arun Prakash

    user8726849 wrote:
    PL/SQL shell script without errorWhat's a PL/SQL shell script?
    Can you please post exactly what you are trying to do (As in the actual code that you are executing and its output)? Also please post it in \ tags (See FAQ).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to upload data from excel to SAP using VB script or Macros

    Hi Guys,
    I want to make a macro enabled Excel sheet which  i can use to upload huge data on SAP . I read some discussion but didnt get anything. Please help me with a step by step document.

    Hi,
    Please refer below link.
    Need help from Excel and SAP expert! [SOLVED]
    http://visualbasic.ittoolbox.com/groups/technical-functional/vb-vba-l/call-transaction-in-sap-from-excel-vba-macro-and-download-alv-list-object-results-to-spreadsheet-3335996
    Regards,
    Rafi

Maybe you are looking for

  • Is it possible to upgrade the Graphics Card on my laptop?

    Hey quick question about my notebook. I own a dv6 laptop with an Nvidia Geforce GT 650M 2GB graphics card, (Here is a link of the laptop if you need more info http://asia.cnet.com/product/hp-pavilion-dv6-core-i7-3720qm-processor-2-6ghz-8gb-ram-459299

  • New JEST & Video Playback Problem

    I've tried to play the 3gpp format video's with WMP & VLC with no luck. I've tried a half dozen codecs including Essentials Codec Pack, and even tried the VZ Navigator interface as well as PC Suite but nothing works for the JEST. Even Pantech hasn't

  • Project wise Payments/Inpayments-S_ALR_87013573

    Hi , I want a report which will show me projectwise inpayments & payment.I tried this using S_ALR_87013573 but doesnt showed me correct info. For example I booked a invoice of amt Rs 100 thru fb60 & payed amt of Rs 50 thru f-53.But the above said rep

  • Safari 3.0.4 and DjVu Browser Plugin: No Go.

    I just installed the 10.4.11 Update (Combo) and everything went fine (it even fixed an old Finder glitch, the eject button next to Network and the menu bar Go/Network broken link), except for Safari, this new version doesn't let me open DjVu files. T

  • Calling Scanner in Forms

    Hi guys I'm facing one problem in forms 6.0. i'm at the completion of my project, but due to this i'm stuck. i'm calling scanner from my application by the following way host ('C:\Program Files\Common Files\Microsoft Shared\mspaper\mspscan',no_prompt