How to use event parameters?

Hello

I did simple EEM applet for the shutdown of the port to which cases of storm of device control.

It's look like this:

Event Manager applet shut-storm

control of storm events

1.0 cli python action local bootflash:shut - storm.py

and the script is

Cisco import CLI

Cisco import cli

import sys

import datetime

time of import

import re

whitelist =]

Ethernet1/1"."

'Ethernet1/2']

shlog = CLI ('sh logg last 100 | I ETHPORT-5-STORM_CONTROL_ABOVE_THRESHOLD: last 3', False) .get_output)

= Pat re.compile (r'(\d {4} \w{3} \d{2} \d\d:\d\d:\d\d) \S+ \%ETHPORT-5-STORM_CONTROL_ABOVE_THRESHOLD: the traffic in the port (Eth\S + |)) (([Pp] o\S +)')

now = datetime.datetime.now)

Delta = datetime.timedelta (second = 180)

for l in shlog:

mobj = pat.match (l)

If mobj:

port = mobj.group (2)

logTimeStr = mobj.group (1)

time.strptime = logTimeObj (logTimeStr, "%Y %b %d % H: % m: %S") ")

logTime = datetime.datetime(*logTimeObj[:6])

If now logTime<>

If port not on the white list:

CLI ("conf t")

CLI ("interface %s" % port)

CLI ("shutdown")

But the python script is a bit complecs because it is located and must find some interfece triggered the newspaper.

Is it possible to use event parameters? And how?

I know that they are:

SW1 # sh event handler det events history

Time of the event event Event Type slot ID policies

32 09/30/2013 15:40:51 storm_control active (1) shut-storm

interface = ' Ethernet1/16', cause = 'storm-control ".

You should be able to:

bootflash:shut local python CLI - storm.py $interface $cause

However, the appeal of scripts Python applets EEM on Nexus is not officially supported, so your mileage may vary.

Tags: Cisco Network

Similar Questions

  • How to use Event Viewer to erase the mistakes/Vista

    How to use the event viewer.in performance information a tools / tools... built a lot of mistakes over time... Vista Home Basic to system op.  also it would help to speed up my computer?... can someone help me please...

    Hello

    To add to the good advice of dax1792:

    MyEventViewer can be verified at the time of the EVENT or the blue screen (BSOD) within a second
    then the EVENT or time of the BSOD for more information on the possible cause - see TIP.

    MyEventViewer - free - a simple alternative in the standard Windows Event Viewer.
    TIP - Options - Advanced filter allows you to see a period of time instead of the whole of the record-
    Set it a bit before and after the time of the EVENT or the BSOD.
    http://www.NirSoft.NET/utils/my_event_viewer.html

    This ulilty also lets you clean (remove) one, several or all the logs in Event Viewer. Only
    real reason to remove them would be to make it easier to read all the new events - those recording after
    compensation.

    ------------------------------

    TechNet - observer of events
    http://TechNet.Microsoft.com/en-us/library/cc766042.aspx

    TechNet - clear an event log
    http://TechNet.Microsoft.com/en-us/library/cc722318.aspx

    I hope this helps.
    --------------------------------------------------------------------------------------------
    Rob Brown - Microsoft MVP<- profile="" -="" windows="" and="" devices="" for="" it :="" bicycle="" -="" mark="" twain="" said="" it="">

  • How to use event.target.name in AS2?

    Thanks kglad, I could see how event.target.name in AS3 could make a button to load a movieclip with the same name.

    I do the same thing now in AS2, but don't know what to write instead of event.target.name.

    And so, at the present time, each button push information in a table and then a function that uses to decide what movieclip to tie to a holder after that he faded once and then fades new...

    BEGINNING OF THE GALLERY OF IMAGES *.
    Add images to the holder
    imgholder.attachMovie ("img0", "image0_0", 1).

    Table
    var nextLoad = ['img0'];

    Listeners of BTN
    img5.onRelease = function() {trace (nextLoad); nextLoad.pop (); nextLoad.push ("img5"); btnClick()} / / written on 1 line
    img4.onRelease = function() {trace (nextLoad); nextLoad.pop (); nextLoad.push ("img4"); btnClick()}
    img3.onRelease = function() {trace (nextLoad); nextLoad.pop (); nextLoad.push ("img3"); btnClick()}
    img2.onRelease = function() {trace (nextLoad); nextLoad.pop (); nextLoad.push ("img2"); btnClick()}
    img1.onRelease = function() {}
    nextLoad.pop ();
    nextLoad.push ("img1");
    btnClick()
    }
    img0.onRelease = function() {}
    nextLoad.pop ();
    nextLoad.push ("img0");
    btnClick()
    }


    The function of btn
    function btnClick() {}
    trace ('click');
    var myImgTween:Object = new Tween (imgholder, "_alpha", Strong.easeOut, 100, 0, 1, true ");
    myImgTween.onMotionFinished = function() {}
    fadeOutImg();
    }
    }

    The function part of II btn
    function fadeOutImg() {}
    trace ("fadeOutImg");
    imgholder.attachMovie (nextLoad, "image1_1", 1);
    var myImgTween:Object = new Tween (imgholder, "_alpha", Strong.easeOut, 0, 100, 1, true ");
    }

    I know I should be able to push the button name in the table, but I meet to use a string... I don't know that my code is heavy! But it works. I tried to push as the name of the button but it end by including the reference to full step.
    Is there a cleaner way to do this using event.target.name?
    Thanks for the research!

    There is no event.target in AS2. However since AS2 has no way to remember the scope object where the target object, you can use this to your advantage to get the name of the target using the command 'that' in the function when you use the format above "mc.onPress = myfunc". FYI, the delegate popular workaround solution, enabled when you called 'this' in the function, you can retrieve the scope object where the target instance. So without her help, "this" will return the name of the target object. In any case, this is the code that you can use:

    imgholder.attachMovie("img0","image0_0",1);

    var nextLoad = ['img0'];

    img5.onRelease = onImgRelease;

    img4.onRelease = onImgRelease;

    img3.onRelease = onImgRelease;

    img2.onRelease = onImgRelease;

    img1.onRelease = onImgRelease;

    img0.onRelease = onImgRelease;

    function onImgRelease (): Void {}

    nextLoad.pop ();

    nextLoad.push (this._name);

    btnClick();

    }

    The function of btn

    function btnClick() {}

    trace ("Click");

    var myImgTween:Object = new Tween (imgholder, "_alpha", Strong.easeOut, 100, 0, 1, true ");

    myImgTween.onMotionFinished = function() {}

    fadeOutImg();

    }

    }

    The function part of II btn

    function fadeOutImg() {}

    trace ("fadeOutImg");

    imgholder.attachMovie(nextLoad,"image1_1",1);

    var myImgTween:Object = new Tween (imgholder, "_alpha", Strong.easeOut, 0, 100, 1, true ");

    }

  • How to use event FDM (vb) scripts in FDMEE


    Hi all

    In my application, I have a few event using VBA scripts.

    When I copied the same script of old FDM to my new app FDMEE it did not work.

    Please let me know what are the steps I need to do to make the old scripts to work in the new application FDMEE.

    Thank you

    HAPPY.

    It could be that your adapter HFM is not registered correctly.

    I can remember the API from VB FDMEE is saved with the HFM adapter.

    I would recommend the deregistration of the adapter and save it again (example):

    Unsubscribe from the command line-> E:\Oracle\Middleware\EPMSystem11R1\products\FinancialDataQuality\bin\UnregisterHFM.vbs

    Command line registry-> E:\Oracle\Middleware\EPMSystem11R1\products\FinancialDataQuality\bin\RegisterHFM.vbs domain\hfmdcomuser password E:\Oracle\Middleware\user_projects\epmsystem1

    You should get a message like this:

    HFM finished recording adapter

    ...

    FDMEE VB API completed registration

    Also, try to use a VB script in a custom script to ignore the problem is related to the script BefImport to create the object.

  • Drop-down list - how to use event handler?

    I can't with setting the readonly (via Javascript) in the adjacent text box property to my drop-down list when the index value is a number.

    I tried to use MouseUp and MouseDown OnBlur even... but the readonly does not always get the value true or false,.

    This could be a timing problem? The text box that I am trying to control is the control tab order in the list of controls for this page.

    This same logic works very well in the MouseUp handler for checkboxes. So I was just wondering if it is a bug or should change the my implementation to accommodate drop-down lists? For example, should I move the logic to the handler Enter the text box instead? An own eventhandler of the control set read-only when it is the active form field does

    -Not quite (it comes after the events of mouse, but before the blur event),

    but it should do for your application. The process of the event is complex. You can

    Learn more on this subject in the reference document on the JS API, under event - form

    processing of the event.

    -C' is correct, although it is not a bad idea to do it explicitly anyway.

    Friday, October 24, 2014, at 16:51, syswizardx, [email protected]>

  • How to use events from time?

    I tried to create a function of weather events, but something is wrong, check this out:

    public void randomNPCMove(t:TimerEvent):void

    {

    var NPCMoveDelay:Timer = new Timer (Math.random () * 1000, 1);
    NPCMoveDelay.addEventListener (TimerEvent.TIMER_COMPLETE, randomNPCMove);

    Alert.Show ("I'm alive");

    }

    The previous fold was right in that you will need to call start() on your clock.  You will also need to move your variable timer (NPCMoveDelay) and the creation of timer outside the service.  You're currently declare it as a variable function which will disappear when the function is finished.

    This documentation of timer can be useful, see the examples:

    http://www.flexafterdark.com/docs/ActionScript-timer

    I hope this helps...

    Ben

  • How to machine status using events.

    Hi all.

    I love to create a state machine using events methos.

    I have 4 functions 1,2,3,4. (event based functios) (separate void / screw)

    1.i will trigger the 1 function.

    then the end of the first function should trigger the following function.

    ..

    as the machine state.

    How to create this method in labview... I tried value signalling its still does not. what I want.


  • How to use the Microsoft Event Viewer to diagnose the breakdowns of the system

    Unless manually modified Windows will log errors in Event Viewer. Information on these errors usually help determine which collapses and why it crashes. Often, they are used to diagnose if the computer shows a blue screen and you are unable to obtain information on the blue screen.

    To run the click Event Viewer on start and start typing event viewer in the search programs and files. When the Event Viewer appears in the list, select it and run the program.

    Once at the Event Viewer you need to descend to the level of the category. There are three broad categories that you want to fix the errors of. You can get to these categories by the expansion of the group Windows logs on the left side. According to newspapers in Windows, you can see Applications, security, and system. It's three groups where you want to see which crashed and why.

    To start, click on the list of applications and you will see a list of events which occurred on the right side. Events fall into three categories

    Information - low

    WARNING - Medium

    Error - high

    Information events can be ignored in general these are things just information on your system. This can be an event as a disk defragmentation has been made and has been a success.

    Warning events have an average level, because more often that otherwise, so it can be ignored and pose no immediate threat to your system.  Caution do not generally broken systems if your computer is crashing or having problems then is not likely caused by the warning events.

    The errors have a high level and if your system crashes that could be due to the error. Since we are talking about the blockages and system errors, we will focus our attention on error events.

    In the screenshot, an error has been highlighted and this is what we will discuss.

    At diagnosis of the fault of the system you must ensure that you first you know what time your system crashed so that you can make sure you are looking at the correct event log. The newspaper of the events above is just an example of an error and is not one which would be generally cause a system crash. It is only for purposes of dimenostrational.

    Now that you have what time the system crash occurred that you want to go to the event viewer and look for the error event. Once find you it you can highlight.

    Once selected, you will find information about the event just below. The first thing you want to note is the description. He will often tell you what crashed and why it crashed and is sometimes followed by an error code or at least included in the description.

    The error code will help you to determine why something is a failure. You can meet the followed a string of numbers such as STOP error: 0x0000007B (0xEB82784C, 0xC0000034, 0x00000000, 0x00000000).

    With the error code can be a file name or a path. Maybe it's not always what causes the error, but it does not say where the error is being generated from, important for the diagnosis of the root causes.

    More information, you are able to capture the best of assistance which can often be given. Blue screens can be tricky to solve in the fact that it can be caused by thousands of different programs and features.

    If you encounter a blue screen, it is important to go into the event viewer and try to capture information as to why the error occurs.

    The event viewer is like your journal of computers. It keeps all this hidden information and it tells the life of computers and what tragic things happen.

    This guide is intended to help you understand what is the event viewer and if you experience crashes how to know why and what causes accidents.

    If you experience crashes or problems using Event Viewer please use the new post and create a thread in which the issue that you are experiencing. Don't forget if you have accidents, including the information from the logs event viewer also help us solve the problem you are experiencing.

  • How to use interval set to raise the event every 5 seconds when if the statement is true?

    Here is a snippet of code something to im:

    if (MC_battleTrigR1a.hitTest(this._x, this._y, true)) {
         if (random(220) == 0) {
         //random(220) the code is onEnterFrame and so this random function is called repeatedly until eventually random(220) == 0;
         trace("random");
         gotoAndStop("battle");
         }
         //setInterval(???)
         //every 5 seconds->  trace("5sec"); and gotoAndStop("battle");
    }
    

    The player wanders in a box, in a random delay or after 5 seconds, it should send the player to the frame labeled: battle

    It works with the random (220) but I don't know how to do certainly go to frame: battle after 5 seconds.

    I don't know how to use setInterval correctly, I tried and failed.
    The code is nested in the onEnterFrame
    FPS: 24

    image tag: treePath

    Chassis number: 17

    I didn't say that you should avoid using onEnterFrame.  I said that your setTimeout must be outside your onEnterFrame loop:

    var tl:MovieClip = this;
    
    tl.onEnterFrame = function () {     if (MC_battleTrigR1a.hitTest(MC_player._x, MC_player._y, true)) {          delete this.onEnterFrame;          clearTimeout(gotoBattleTO);          gotoBattle();     }};
    
    
    
    function gotoBattle() {     clearTimeout(gotoBattleTO);     delete tl.onEnterFrame;     gotoAndStop("battle");}
    
    
    var gotoBattleTO:Number = setTimeout(gotoBattle,5000);
    
  • How to use % symbol for parameters in conditions in Discoverer

    Hi all

    In fact, I have to add four settings in that
    two param should be % (average for select all) as a default.

    That is to say that we use LIKE '%' in the query.

    the problem is when I enter a value for a parameter, it should train for this value,
    and if I need anything, I should enter the "%" symbol,

    so, for what Iam confused how to use this,

    Although I tried with a few options, it receives satisfactory results.

    someone will help me please to achieve this.

    Thank you in advance

    Published by: user10271105 on Sep 17, 2008 03:37

    Hello

    You can create a parameter and give % as default. If you set the condition to use AS and when the default is used for the parameter, then the query contains LIKE '%' and everything is selected.

    If you are using a list of values with your parameter, then you must add the '%' to your list of values so that the user can select this value.

    However, this method will not work if some values in your database contains characters of percentage, because the condition LIKE 'ABC DEF %' will return as well as ABC % DEF ABCXYZDEF.

    Unfortunately like escape syntax is not available in discoverer, so you have to invent a value that the user can enter for all, for example ALL the default value for the parameter.

    Then use a similar State to:

    question LIKE: param OR item = DECODE (: param,'* ALL *', item)

    Rod West

  • How to copy events in a library of photos on an external drive

    Hello I need to know how to copy events in a photo library on an external drive.

    I have OS X El Capitan 10.11.6

    Thanks for the help

    as the pictures has no events which is not possible - and you cannot copy to a library of photos to another library - you can export to a library and import in another library or you can use PowerPhotos to move photos between libraries

    What exactly do you have and exactly what you want to accomplish?

    LN

  • How to use the functionality of search in Spotlight

    I was check preferences, Spotlight and noted down at the bottom of the window there is a box marked 'allow Spotlight Suggestions in Spotlight and look it up".

    I was curious about the 'Look up' and how it worked but after Googling it I couldn't find any reference to it or how to use it.

    I wonder if someone could enlighten me on what it does and how I use it.

    Thank you

    'Search' is not a feature turned on. If you have this box checked, then it is already working.

    The difference between the projectors now and Spotlight before "Look up", it's that Spotlight will now search the Internet for items that you put in the Spotlight. Previously, Spotlight search only files of your computer. Now (with the upward gaze) research in Spotlight is similar to an iOS devices. If she can not find what you are looking for on your computer, it will search the internet. For example, if I type in warriors, it returns this information:

    Hope that makes sense

    EDIT: Note that research first of all my events (since I'm a Kings fan, it shows their game against the warriors), and he then proceeds to the internet looking for other options, as well as iTunes for the film the warriors.

  • How to use IMAQ Bayer to RGB?

    Hello everyone.

    Could you please tell how to use IMAQ Bayer to RGB. I read the help that need us Bayer settings. But in aid have no structure of the Parameters of Bayer. I find any example of Bayer IMAQ to RGB and Parameters of Bayer in Labview

    Please read my poor English and help me!

    Hello

    What kind of bus of camera do you use? (Camera Link, GigE, FireWire, etc.).  When you buy a MAX image seems to have the grid of bayer?  Have you tried to adjust the color of bayer camera in MAX?

    There are two examples delivered with Acquisition of Vision software that indicate how to Bayer for the other NOR-IMAQ for NOR-IMAQdx decodes.  If you open finder LabVIEW example by going to help > examples find you can search enter with Bayer Decoding.vi or Grab and Bayer Decoding.vi.

  • How to use IMAQ detected Shapes.vi

    Hi all

    I learn NI Vision, I don't understand how to use IMAQ detected Shapes.vi to detect shapes, such as lines, ellipses, who can give me an example, thank you.

    Hello

    This function uses the edges of the object and try to adapt with different shapes such as rectangles, lines, or some cirles.

    First of all, you need to set parameters to extract the edges of your objects. You Brown the threshold (in order to find the correct edges of your object). You can then choose the parameters of the shape to fit. For example if you want to adjust with a circle, you set the min and max possible RADIUS.

    Try this with vision assistant, it will be easier. And try also with fine contrasting images.

    Concerning

  • How to use RAS queue?

    Hi all

    So I have some difficulties to use the queue of the hunting event, I would like to know how to use it before you put it, I use a very simple test of Vi.

    So, if anyone has an idea?

    Thanks for the future repply

    Looks better,

    Guillaume.

    Read the care and recommendations for using events in LabVIEW - LabVIEW 2013 help .

Maybe you are looking for

  • How much does it cost to exchange the speaker of my computer

    Hello world!Sorry for my bad English. I have a toshiba A300 computer. I try to protect the envelope of my sweat support piece so I place a phone portable protective shield on the left side of the envelope of decision-making support. Now, when I remov

  • Satellite P100-160: How do I get an audio driver for XP

    Can someone tell me how to get a sound driver for the P100-160. I have a bought a machine expect to be able to use it for my work, as Vista does not support applications that I use I have to install XP. Then I find that Toshiba seem to have selected

  • access control using the control panel handle

    Is it possible to access the constant name when I only have the panelHandle of the IUR. The control is part of the different project and panelHandle went from the first project for the second project. Second project now need to set the value of the c

  • Defragmentation and menu of services

    Hello Looked defragger computer hubbys to see he did not task since 2007!  Considered the responses all over the internet and I am now stuck. Scheduled task has been set to automatic but the calendar says 'never' to perform according to defrag.  I we

  • (Windows Mail) messaging

    E-mail opens in a reduced size. I then have to decompress. How to open maximized? Thank you