Cisco integrated event handler problem

Hello Experts,

I took the following sample EEM

https://learningnetwork.Cisco.com/blogs/network-Sheriff/2009/06/19/writing-your-first-EEM-applet

The intention is to send a notification to an email address on a network problem. I modified it bit as illustration. You will see that there are various show commands.

Can someone show me please how to send show rather commands simply by adding them to the directory called "server_unreachable"?

TechWiseTV4506 (config) #eve

(_email_server 172.16.1.44) NT Manager environment<-my post="" cast="">

TechWiseTV4506 (config) #event Manager environment _email_to [email protected] / * /

TechWiseTV4506 (config) #event Manager environment _email_from [email protected] / * /

Event Manager applet email_server_unreachable

Event track 10 down state

message from syslog to action 1.0 "Houston we have a problem. Ping failed, inaccessible Server! »

command action 1.1 cli 'enable '.

Action 1.2 cli command "del/force flash: server_unreachable.

action 1.3 cli command "display the clock | Add server_unreachable.

action 1.4 cli command "show ip arp 172.16.1.55 | Add server_unreachable.

action 1.5 cli command "show ip route 172.16.1.55 | Add server_unreachable.

action 1.6 cli command "show interface FastEthernet0/1/1 | Add server_unreachable.

action 1.7 cli command "flash: server_unreachable more»

Action 1.8 mail server "$_email_server" to "$_email_to" of "$_email_from" subject "inaccessible server: ICMP-echo has no" body "$_cli_result»

Action 1.9 msg syslog "Server unavailable alert has been sent to the mail server!

See you soon

Carlton

This cmdlet will actually results by e-mail.  However, in order to get all of the whole output, it uses the file server_unreachable as a buffer from the accumulator.  This file could be deleted as an action 2.0:

Action 2.0 cli command "remove/force flash: server_unreachable.

But it is already there in action 1.2, so it is not really necessary.

What will happen, this is the applet will be more the file to collect all of the production.  This aggregate output is stored in the variable of _cli_result $.  The result is that the body of your email will contain the result of the consolidated order.

Tags: Cisco Network

Similar Questions

  • Trigger event handler problem

    Hello
    I am facing a problem in the event handler, I'm pre process handler.bellow event is the steps that I followed and did all the steps correctly, but the event handler is not triggered.

    the steps that I follow is
    (1) develop a java class in which I will put middle name if the user does not have a middle name in the form of IOM in the CREATE operation.

    import java.io.Serializable;
    import java.util.HashMap;

    import com.thortech.util.logging.Logger;
    Import oracle.iam.platform.context.ContextAware;
    Import oracle.iam.platform.kernel.spi.PreProcessHandler;
    Import oracle.iam.platform.kernel.vo.AbstractGenericOrchestration;
    Import oracle.iam.platform.kernel.vo.BulkEventResult;
    Import oracle.iam.platform.kernel.vo.BulkOrchestration;
    Import oracle.iam.platform.kernel.vo.EventResult;
    Import oracle.iam.platform.kernel.vo.Orchestration;

    * / public class NamePreProcessEventHandlers implements PreProcessHandler {*}

    private logger = Logger.getLogger Logger ("logger name Handel");

    private String methodName ="";
    public NamePreProcessEventHandlers()
    *{*
    debug ("invoking NamePreProcessEventHandlers");
    *}*
    *@Override*
    public cancel Boolean (long arg0, arg1 is long,
    * AbstractGenericOrchestration arg2) {*}
    * / / TODO self-generated stub method *.
    Returns false;
    *}*

    *@Override*
    public void offset (long arg0, arg1 is long,
    * AbstractGenericOrchestration arg2) {*}
    * / / TODO self-generated stub method *.

    *}*

    * / / Write your implementation.*
    * Public EventResult run (long processId, long eventId, orchestration of the Orchestration) {*}
    * / / TODO self-generated stub method *.


    this.methodName = "execute";
    * / / This method get the parameters of the request of IOM form *.
    HashMap parameters = orchestration.getParameters ();

    debug ("settings" + settings);
    String operation = orchestration.getOperation ();
    debug ("operation process pre" + operation);

    If (operation! = null & & operation.equalsIgnoreCase ("create"))
    *{*
    String firstName = getParamaterValue (settings, "First name")
    If (firstName! = null & &! firstName.trim () .isEmpty ())
    *{*
    If (! parameters.containsKey ("Middle Name"))
    *{*
    orchestration.addParameter ("Name", firstName.substring (0,1));
    *}*
    *}*

    *}*
    return new EventResult();
    *}*

    *@Override*
    * Public BulkEventResult run (long arg0, long arg1, arg2 BulkOrchestration) {*}
    * / / TODO self-generated stub method *.
    Returns a null value.
    *}*

    *@Override*
    * public Sub initialize (HashMap arg0) {*}
    * / / TODO self-generated stub method *.

    *}*

    */***
    The value of request parameters obtaining *.
    **/*
    private String getParamaterValue (parameters HashMap,
    * String key) {*}
    String value = (parameters.get (key) instanceof ContextAware)
    *? (String) ((ContextAware) parameters.get (key)) .getObjectValue () *.
    *: (String) parameters.get (key); *
    Returns the value;
    *}*

    private void debug (String message)
    *{*
    Logger.Debug (this.) GetClass(). "GetName() +": "+ methodName +": "+ message);
    *}*
    *}*

    (2) create a jar named NamePreProcessEventHandlers.jar file and paste it into the LIB directory.

    (3) develpo a config to custom handler file as follows

    * < eventhandlers xmlns = "http://www.oracle.com/schema/oim/platform/kernel" xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" xsi: schemaLocation = "http://www.oracle.com/schema/oim/platform/kernel orchestration - handlers.xsd" > *.
    "< * class =" test.eventhandlers.NamePreProcessEventHandlers action-Manager' entity-type = 'User' operation = "CREATE" name = "NamePreProcessEventHandlers" Stadium = "preprocess" order = "FIRST" sync = "TRUE" / >. *
    * < / eventhandlers > *.

    (4) create a plugin.xml file

    * < eventhandlers xmlns = "http://www.oracle.com/schema/oim/platform/kernel" xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" xsi: schemaLocation = "http://www.oracle.com/schema/oim/platform/kernel orchestration - handlers.xsd" > *.
    "< * class =" test.eventhandlers.NamePreProcessEventHandlers action-Manager' entity-type = 'User' operation = "CREATE" name = "NamePreProcessEventHandlers" Stadium = "preprocess" order = "FIRST" sync = "TRUE" / >. *
    * < / eventhandlers > *.
    (5) make an Eventhandler of the zip file in which I placed the plugin.xml and lNamePreProcessEventHandlers.jar
    (6) save the plugin file to the server of the IOM
    (7) import of the event custom in the MDS.
    (8) clear the cache and restart the server of the IOM.

    (9) then create user page in free service, but the event handler is not triggered.

    Please help as I am with IOM 11gr2.was I miss some steps or above process is sufficient.

    Thank you and regars
    $

    All looks good, but your plugin.xml is not correct.

    Go to the format below and try again.






  • [JS CS5] problem with memory leak possible with the dialog box in the event handler

    Hello

    I'm having a very difficult problem.

    I am attaching a script in a handler for a menu item, by using an installation script menu that I wrote based on one by Marc Autret. My version of the script menu installation attach a bunch of event handlers at the same time, to the actions of different menu.

    What is the event handler, with that I have a problem is to prompt the user for a URL and then applies the URL as a hyperlink to the text selection, with our house style for the way in which the URL should look like.

    The problem is the following:

    1. all other installed menu actions work very well, except for this one.

    2. the addition of URL script works fine, when you run it directly from the script menu.

    3. the combination of #1 and #2 (using the script to add URL by function as an event handler in the Edit menu) blocks to InDesign. But it is only after the addition of URL script has finished and done what it was supposed to do!

    4. when I comment on the section of the script URL adding user input, so that instead of saying

    userInput = myDisplayDialog();
    

    It is said

    userInput = "http://thisworks.com";   // userInput = myDisplayDialog();
    

    It works well as an event handler.

    So obviously a problem with the dialog box, but only when adding URL script is executed as an event handler. My first guess is that this is some kind of memory leak, but I think I am following the model of. destroy() the way I saw it elsewhere.

    Someone knows something like that before?

    I can provide all relevant if necessary scripts, but they are quite complicated. The most important of them is the input of the user function. Here it is:

    var myDisplayDialog = function( defaultText ) {
      
        var defaultText = defaultText || "";
        
        var myDialog = app.dialogs.add({
            name: "Type in a URL"
        });
        
        var myOuterColumns = [];
        var myInnerColumns = [];
        var myOuterRows = [];
        var myBorderPanels = [];
        var myTextEditboxes = [];
        var myInput;
        
        myOuterColumns[0] = myDialog.dialogColumns.add();
        myOuterRows[0] = myOuterColumns[0].dialogRows.add();
    
    
        myBorderPanels[0] = myOuterRows[0].borderPanels.add();
        myInnerColumns[0] = myBorderPanels[0].dialogColumns.add();
        myInnerColumns[0].staticTexts.add({
            staticLabel: "URL:"
        });
        
        myInnerColumns[1] = myBorderPanels[0].dialogColumns.add();
            
        myTextEditboxes[0] = myInnerColumns[1].textEditboxes.add({
             minWidth: 300,
             editContents: defaultText ? defaultText : "http://"
        });
        
        var myResult = myDialog.show();
        var myInput = myTextEditboxes[0].editContents;
        
        myDialog.destroy();
    
        if (myResult == false) {
              exit();
        }
        
        return myInput;
    
    }
    
    

    Hi Richard,

    Unfortunately, there is no guarantee that the ScriptUI longer work.

    Thake a peek here: http://forums.adobe.com/message/2881364

    --

    Marijan (tomaxxi)

    http://tomaxxi.com

  • Epson Event Manager cannot find the scanner driver. Epson said that the event handler is a windows thing, and so is the problem.

    I installed an Epson Stylus SX215. I can print, scan and copy if I use another way, but if I want to use the event handler it says that it cannot find the scanner driver may not use the event handler at all (cannot yet open the program).
    In addition, the scan option "attached to electronic mail" does nothing either. Don't know if this is because the event handler program or because he can not see e-mail programs I have.

    Hi bdelrio,

    Thanks for posting. Try running a System File Checker to find errors.

    Click Start.
    In the search box type cmd
    In the menu start right click on cmd.exe and select Run - As-Administrator.
    In the command prompt, type "sfc/scannow".
    Allow this to fill and run. Please let us know if this corrects and error, or if it reports errors, it cannot fix.

    Thank you! Shawn - Support Engineer - MCP, MCDST
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think

  • How can I access the data associated with an event within the event handler function?

    Hello

    In my LabWindows code, I try to use a DLL that has been developed in .NET (c#).  I used the built-in labwindows Wizard that converts the DLL to a usable 'instrument'.  Almost everything seems to work, except that I have 1 problem.

    There is an event (defined in the DLL) that I am able to detect.  I know that the reminder of the event is called at the right time.  But the problem is that in this function, I can't access the data that is supposed to be attached to the event.  It worked fine in c#, but I don't know how to do in LabWindows.  Here's what looked like in c# event handler function:

    void AppLoaderEventCallback (CommonLib.CommandResult MyResults)

    {

    MyResults is used in the body of this function

    }

    But in LabWindows, I can't seem to access the MyResults data structure.  Here's what I do:

    public static int CVICALLBACK AppLoaderEventCallback (CommonLib_CommandResult MyResults)

    {

    I can't access MyResults here

    }

    Can you help me with this?  I'm doing something wrong?

    Thank you very much for your help.

    -Mike

    I think that your statement of callback function is perhaps not quite correct. Look using the parameter "callback function" function Panel of the generated __Create function associated with this event. This shows the declaration of the callback function - make sure that your callback function is declared in the same way.

  • How can I resize window "script event handler?

    How can I resize window "script event handler? (I entered in a script long as event handler script. After adding the script, I can't view or scroll key buttons on the right) .attached is a screenshot of the problem I am facing.a.jpg

    Quit photoshop and go to

    For Photoshop CS6

    Photoshop CS6 Photoshop C:\Users\Your Name\AppData\Roaming\Adobe\Adobe CS6\Adobe settings

    For Photoshop CC

    C:\Users\Your Name\AppData\Roaming\Adobe\Adobe Photoshop CS6\Adobe Photoshop CC settings

    remove the

    Script Manager.xml events

    then restart photoshop


    I think that the events are for something like select menu or tool (filter), and then this, for example.

    For your script, probably add using skip under Script would be preferable.



  • The onDeactivate event handler does not work in InDesign CC. Why?

    Hi guys.

    I'm working on a script in Javascript for InDesign CC.

    The big problem is that the onDeactivate event handler does not work.

    Here is an example that works in InDesign CSx, but not in InDesign CC:

    #target indesign
    var w = new Window ("dialog", "Test onDeactivate");
    var et_1 = w.add("edittext", [undefined, undefined, 300, 30], "Lorem ipsum");
    var et_2 = w.add("edittext", [undefined, undefined, 300, 30], "Dolor sit amet");
    var st = w.add("statictext", [undefined, undefined, 300, 30], "CONSOLE:\r\r", {multiline: true});
    et_1.onDeactivate = et_2.onDeactivate = function(){
         st.text = "CONSOLE: I left the field with this text:\r\t«" + this.text +"»"; }
    var b_ok = w.add("button", undefined, "OK");
    w.show();
    

    The script displays a dialog with text edit fields window 2: when a field loses focus (by clicking on the other), the "CONSOLE" shows the text of the old domain.

    Adobe, please, solve this problem as soon as possible.

    Thank you.

    Giorgio

    This is a bug, and it has been reported. Please report it to yourself, more the better reports. It's no good Adobe invite you in this forum to fix something.

    Peter

  • Pretreat the Event Handler Question

    I developed a class according to the metalink notes 1262803.1 'Sample Code for A Custom event handler implemented for process prior to the course create user management look' it worked fine but I have the following problem:
    The algorithm must search for users in order to generate a user id, and this process uses the OIMClient Api which requires a connection to the IOM (Username, Passwor and provider_url). I don't want to encode any variable.
    OimClient has something like anonynous connection?
    Is necessary use a properties file to specify the connection information?

    Thank you

    Your event handlers, you can use Platform.getService () method instead of using oimClient. Platform is available inside the IOM and would go without credentials.

    HTH,
    BB

  • Event handler does not

    Greetings!

    My college professor told me about flash builder and it's good for mobile applications. I've never done anything with actionscript before and had my first foray in recent days. However, I quickly ran into a problem. I draw a rectangle and are now trying to use event handlers. For now, I meant add the event handler for click on the rectangle. When to perform a specified function.

    rectangle.addEventListener (MouseEvent.CLICK, RectClicked);

    But even if there is nothing wrong anywhere in my application when you click the first rectangle, nothing happens. This is true for other events of mouse and keyboard. My teacher said that it may have something to do with saw generator flash student at College and currently having the trial here at home. It may not allow you to use certain features.

    What I have to buy flash builder first before being able to use certain features?

    Hey Koopa,

    The two examples that I've downloaded work, so...

    When you're in FlashBuilder, there are a number of different default options to run.

    1. There is an option "Debug".

    2. There is an option "Run".

    3. There is a 'Profile' option (may be available only in Pro version)

    The 'Debug' option passes with tracks included and connects the debugger in any browser plugin you use (if you have version _installΘe_ the debugger player http://www.adobe.com/support/flashplayer/downloads.html ). THIS IS the OPTION DESIRED if you want to see traces.

    The 'game' option just fires the film and has no connection with the debugger.

    The 'Profile' option is almost certainly a little more that you're ready for.

    Check, then check again, that you run and you should see all workers.

    G

  • Correct way to use an event handler

    What follows is dynamically adds a series of buttons and a label to each button. The problem is that the event handler is triggered two times for each button, and the last button never gets Treaty at all.

    Should I use a different ResizeEvent.RESIZE event handler? How can I add the label to the last button in the sequence?

    Thank you.

    <? XML version = "1.0" encoding = "utf-8"? >
    " < = xmlns:mx mx:Application ' http://www.Adobe.com/2006/MXML "layout ="absolute"creationComplete =" init () "> "
    < mx:Script >
    <! [CDATA]
    Import mx.events.ResizeEvent;
    private var button: Button2;
    public var numButtons:Number = 5;
    private var counter: Number = 0;
    public void init (): void {}
    for (var i: int = 0; i < numButtons; i ++) {}
    button = new Button2;
    hbox.addChild (button)
    button.addEventListener (ResizeEvent.RESIZE, handleButtonAdded)
    }
    }
    private void handleButtonAdded(e:ResizeEvent):void {}
    counter ++
    trace (e.Target)
    e.Target.label = String (counter);
    button.removeEventListener (ResizeEvent.RESIZE, handleButtonAdded)
    }

    []] >
    < / mx:Script >
    < mx:HBox id = "hbox" horizontalGap = "0" / >
    < / mx:Application >

    This is the button: Button2.mxml

    <? XML version = "1.0" encoding = "utf-8"? >
    " < = xmlns:mx mx:Button ' http://www.Adobe.com/2006/MXML "creationComplete ="init ()">
    < mx:Script >
    <! [CDATA]
    public void init (): void {}
    This.Width = 100;
    }
    []] >
    < / mx:Script >
    < / mx:Button >

    Hmm, what you trying to do?  There are a few questionable things happening.  Your event handler is called "handleButtonAdded", but it takes a ResizeEvent? Do you mean to trigger an event in function when the button has been added to the scene, or a parent like FlexEvent.ADDED or when the creation is complete, FlexEvent.CREATION_COMPLETE?

    The second thing is your variable 'button '.  It is declared outside the loop in function 'init '.  Which means that, when this loop ends and even during execution, it will point to the last created button.  So all buttons have listeners, which means when a button trigger a ResizeEvent, it will remove the listener for all pointing to your variable 'button '.  Is guaranteed (well, maybe not) the behavior that your last button is NOT a listener, that's why he won't shoot.

    In addition, you can set the size of the button and the label when you declare them. You have to subclass and use headphones.

  • event handler issues

    Hello


    I have problems with an event handler that I am creating.

    I have currently 2 handlers, needed only happen when shift + a button is pressed. I currently have:

    function keypressedHandler(event:KeyboardEvent):void {if ((event.shiftKey) + (event.keyCode is 81)) {//something would happen}}


    So my question is how can we get the shift feature works? It doesn't matter if it isn't shift but Alt or Ctrl would be the alternatives.

    Any help would be great,

    Thank you

    Instead of the sign to use the logical AND operator, you must sign & (and):

    stage.addEventListener (KeyboardEvent.KEY_DOWN, keypressedHandler)

    function keypressedHandler(event:KeyboardEvent):void
    {
    If ((event.shiftKey) & (event.keyCode == 65))
    {

    something happen
    trace ('shift and 65')
    }
    }

  • Help with the scripts of "event handler".

    Ok. I am new to using event handler and the Listener Script for I have not every little thing down yet.

    What I'm trying to do is set up an event handler to activate a script when I select a layer. As I have now, the active script no matter what I choose and I'm unable to limit it to only activate when I select a layer. The ScriptListener output was:

    var idslct = charIDToTypeID ("TPCV");
    var desc10 = new ActionDescriptor();
    var idnull = charIDToTypeID ("null");
    ref19 var = new ActionReference();
    var idLyr = charIDToTypeID ("Lyr");
    ref19.putName (idLyr, 'Face');
    desc10.putReference (idnull, ref19);
    var idMkVs = charIDToTypeID ("MKV");
    desc10.putBoolean (idMkVs, false);
    executeAction (idslct, desc10, DialogModes.NO);

    I used TPCV under the name of the event during the creation of the new event in the event handler. However, this same ID is used when a tool is selected. This isn't a huge problem, but for the fact that my reason for setting this up is so that when I select a layer, first I want to implement a predefined specific tool to use on it. If I can change the tools (select another tool) and have always the same layer selected in the script automatically selects the initial tool to the layer which is always selected this layer is always the active layer.

    Example: Suppose I have the following layers...

    Texture

    Heal

    Tones

    Eyes

    Lips

    Face

    These are not my normal layers, but for example when I select the layer "Cure" I would like to start with the Healing Brush tool. However, sometimes I want to use clone on this layer as well. Using the event at this time, Heal would still be the active layer when I make the choice to the clone tool so the script would then return the selected tool, Healing Brush tool.

    So, is it possible to limit the selection event ID to activate only when a layer is selected? I noticed that the line above in bold/red is the event ID of layer. I don't know how to do this in the event handler or the script.

    Thanks for any help.

    Mike

    Here ya go...

    //
    // SelectLayerHandler.jsx
    //
    
    function _selectLayerHandler(desc) {
      // do whatever when a layer is selected
      var doc = app.activeDocument;
      var layer = doc.activeLayer;
      alert("Layer " + layer.name + " selected");
    };
    
    cTID = function(s) { return app.charIDToTypeID(s); };
    sTID = function(s) { return app.stringIDToTypeID(s); };
    
    try {
      if (arguments.length >= 2) {
        var desc = arguments[0];
        var event = arguments[1];
        if (event == cTID('slct')) {
          var ref = desc.getReference(cTID('null'));
          var cls = ref.getDesiredClass();
          if (cls == cTID('Lyr ')) {
            _selectLayerHandler(desc);
          }
        }
      }
    } catch (e) {
      alert( "Error: " + e + ":" + e.line );
    }
    
    "SelectLayerHandler.jsx";
    // EOF
    
  • Error during execution of the event handler

    Hello

    I've implemented a before update event handler (made sure the name is true, the package is right, file loaded on the server, the java code compiled in jdeveloper) but had this error during execution. -What this means and how can I solve this problem?

    Thank you

    ERROR, 4 June 2009 17:25:32, 701, [XELLERATE. SERVER], class/method: tcDataObj/eventPreUpdate some problems: Event handler com.oracle.events.UcdCheckAndSetSponUserExpDate has no name assignedjava.lang.RuntimeException: Event handler com.oracle.events.UcdCheckAndSetSponUserExpDate has no name assigned
    at com.thortech.xl.client.events.tcBaseEvent.run (unknown Source)
    at com.thortech.xl.dataobj.tcDataObj.runEvent (unknown Source)
    at com.thortech.xl.dataobj.tcDataObj.eventPreUpdate (unknown Source)
    at com.thortech.xl.dataobj.tcUSR.eventPreUpdate (unknown Source)
    at com.thortech.xl.dataobj.tcDataObj.update (unknown Source)
    at com.thortech.xl.dataobj.tcDataObj.save (unknown Source)
    at com.thortech.xl.dataobj.tcTableDataObj.save (unknown Source)
    at com.thortech.xl.ejb.beansimpl.tcUserOperationsBean.updateUserData (unknown Source)

    In your constructor did you set the name of the event handler?

    Something like:

    setEventName("Enter-a-name-here");

    Best regards
    / Martin

  • have new macbookpro15 event handler 2.51.06 is necessary

    macbookpro15 new 2.51.06 event handler is required, this icon appears whenever the mac is restarted

    You have a printer/Scanner Epson attached to your Mac?

    If you do, try to update the printer driver on the Epson support site.

    Best.

  • Is there a c# example to use the event handler ExpressionEdit Custom Button control

    TestStand 4.1

    VISUAL C# 2008

    I've added the event handler for ExpressionEdit events as I would any event handler:

    exprEdit.ButtonClick += new NationalInstruments.TestStand.Interop.UI.Ax._ExpressionEditEvents_ButtonClickEventHandler (_ExpressionEditEvents_ButtonClickEvent);

    Then, I create the event handler using the syntax

    public void _ExpressionEditEvents_ButtonClickEvent(NationalInstruments.TestStand.Interop.UI.ExpressionEditButton btn)

    {

    }

    I get the following error when I compile Isaiah:

    Error 1 no overload for delegate matches '_ExpressionEditEvents_ButtonClickEvent' 'NationalInstruments.TestStand.Interop.UI.Ax._ExpressionEditEvents_ButtonClickEventHandler '.

    I guess that means that I don't have the right parameters or types in my statement of event handler, but it corresponds to the object browser.  Any ideas on what I'm missing?

    See my last edition but I think you want your handler to look like this:

    Public Sub exprEdit_ButtonClick (ByVal sender,
    NationalInstruments.TestStand.Interop.UI.Ax._ExpressionEditEvents_ButtonClickEvent
    (e)

Maybe you are looking for