How to correlate two events into 1 action

I am trying to build at eem trigger that takes two events and only runs the action once if the either one of them is true,   but I can't seem to figure out the syntax
my simple script for testing,  produces two syslog message if both events are true.    I would like it to just run the "action" once for each occurs
no event manager applet check_wireless_stats
event manager applet check_wireless_stats
event tag n1 snmp oid 1.3.6.1.4.1.9.9.661.1.3.4.1.1.1.18  get-type exact entry-op le entry-val 0 poll-interval 30 maxrun 1000
event tag n2 snmp  oid 1.3.6.1.4.1.9.9.661.1.3.4.1.1.2.18 get-type exact entry-op le entry-val 0 poll-interval 30
trigger occurs 1
correlate event n1 or event n2
action 002 syslog msg "the event occurred"
I need to be able to run the script once if any of these events occurs or both events occur and not have it trigger the actions twice.
i.e. something like
  correlate [event n1 andnot event n2] or [event n2 andnot event n1] or [event n1 and event n2]

Try adding this to your applet to emulate a mutex:
action 1.0 cli command "enable"
action 2.0 cli command "show event manager scheduler thread queue-type applet detailed | incl check_wireless_stats"
action 2.1 set instances 0
action 3.0 foreach line $_cli_result "\n"
action 3.1  regexp "name: check_wireless_stats" $line match
action 4.0  if "$_regexp_result" eq 1
action 5.0   increment instances
action 6.0  end
action 7.0 end
action 8.0 if "$instances" ge 2
action 9.0  exit 0
action 9.1 end
action 9.2 syslog msg "the event occurred"

Similar Messages

  • Sapscript: How to combine two elements into a block when display ?

    /E  ITEM_CONDITIONS
    /:   PROTECT
    ZC &KOMVD-VTEXT&,,&KOMVD-KWERT&
    /:   ENDPROTECT
    /E  TOTAL_AMOUNT_ITEMS
    /:   PROTECT
    ZC &KOMK-SUPOS&
    /:   ENDPROTECT
    Hi, all. May i know how to combine the two elements into a same block when displaying?
    That's mean this two element content will not be split into two part between two pages when there is insufficient space in the front page.
    Thanks.
    Edited by: Jiansi Lim on Oct 8, 2008 12:24 AM

    You can evoke the PROTECT..ENDPROTECT in the print program before the call of the text elements.
          CALL FUNCTION 'CONTROL_FORM'
            EXPORTING
              command = 'PROTECT'.
          CALL FUNCTION 'CONTROL_FORM'
            EXPORTING
              command = 'ENDPROTECT'.

  • How to arrange two items into a row in the webdynpro provided by SAP?

    I am trying to custormize the ESS personal information - address info.
    My question is that how to put two separate items (like City and Address) into a same row?
    That is to change
    City: xxx
    Address: bbb
    to
    City: xxx     Address: bbb
    ps: I didn't got the NWDI, former changes were made by the ctrl + right clk.
    Thanks in advance!

    Hi,
       As like Shemim said, you can set the RootUIElementContainer layout property as Matrix Layout and in the UI Element (ie. label), Change the layoutdata property to MatrixHeadData to start in New line and to the show in the label in same line, set layoutdata property to MatrixData
    Regards,
    Venkatesh. K
    /* Points are Welcome */

  • How to Combine two queries into One

    Hi Gurus,
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Release 10.2.0.4.0 - 64bit Production
    PL/SQL Release 10.2.0.4.0 - Production
    CORE    10.2.0.4.0      Production
    TNS for Linux: Version 10.2.0.4.0 - Production
    NLSRTL Version 10.2.0.4.0 - Production
    SQL>
    I have following two queries. How I can convert these two queries into one with the same result ?
    Q1
    SELECT id,vdate,vendorname,venddate,vid
    FROM VENDOR
    WHERE processid=32
    AND venddate is null
    AND vid in(select vid from view_vid where type='PDX')
    AND (id,vdate) not in (select id,vdate from vkfl_is where task_id=55)
    AND (id,vdate) in (select id,vidate from market_data where marketed_date is null)
    AND id not in (select id from location)
    Q2
    SELECT id,vdate,vendorname,venddate,vid
    FROM VENDOR
    WHERE processid=20
    AND venddate is null
    AND vid in(select vid from view_vid where type='PBX')
    AND (id,vdate) not in (select id,vdate from vkfl_is where task_id=40)
    AND (id,vdate) in (select id,vidate from market_data where region_date is null)
    AND id not in (select id from location)
    I can UNION these two queries, but, is there any way I can write a single query with which gives me same result as above two queries?
    Any help would be highly appreciated
    Thanks in advance

    Hi,
    You can do something like this, which will be more efficient than a UNION:
    SELECT  id, vdate, vendorname, venddate, vid
    FROM  vendor
    WHERE  (   (    -- Conditions that apply only to q1
                               processid = 32
                AND  vid       IN (SELECT vid FROM view_vid WHERE type = 'PDX')
                AND (id,vdate) NOT IN ( SELECT id, vdate
                                        FROM   vkfl_is
                                        WHERE  task_id = 55
                AND (id,vdate) IN ( SELECT id, vidate
                                    FROM   market_data
                                    WHERE  marketed_date IS NULL
            OR  (  -- Conditions that apply only to q2
                     processid = 20
                AND  vid       IN (SELECT vid FROM view_vid WHERE type = 'PBX')
                AND (id,vdate) NOT IN ( SELECT id, vdate
                                        FROM   vkfl_is
                                        WHERE  task_id = 40
                AND (id,vdate) IN ( SELECT  id, vidate
                                    FROM  market_data
                                    WHERE  region_date IS NULL
                   -- The remaining conditions apply to both q1 and q2
    AND     venddate   IS NULL
    AND     id         NOT IN (SELECT id FROM location)
    I hope this answers your question.
    If not, post  a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and also post the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    See the forum FAQ: https://forums.oracle.com/message/9362002

  • How to Combine Two SubPaths into a Single SubPath

    For CS 5, ActionScript:
    I have a Path which contains two subpaths, which may or may not overlap.
    How do I combine them into a single SubPath (i.e., union) via scripting?
    I know that in the GUI, I can select both SubPaths and then press the "combine" button - this is the effect I want.
    TIA,
    mlavie

    This should combine the first path in the Paths Panel:
    // 2012, use at your own risk;
    #target photoshop
    if (app.documents.length > 0) {
    var myDocument = app.activeDocument;
    if (myDocument.pathItems.length > 0) {
    myDocument.pathItems[0].select();
    // =======================================================
    var idcombine = stringIDToTypeID( "combine" );
        var desc10 = new ActionDescriptor();
        var idnull = charIDToTypeID( "null" );
            var ref7 = new ActionReference();
            var idPath = charIDToTypeID( "Path" );
            var idOrdn = charIDToTypeID( "Ordn" );
            var idTrgt = charIDToTypeID( "Trgt" );
            ref7.putEnumerated( idPath, idOrdn, idTrgt );
        desc10.putReference( idnull, ref7 );
    executeAction( idcombine, desc10, DialogModes.NO );

  • How to concatenate two colums into one single column

    I need some ideas to concatenate two different columns into one single column using a set of distinct values.
    For Example,
    Customer Product Number
    xyz A 1
    xyz B 2
    xyz B 1
    AAA C 7
    AAA A 1
    The result should look like this,
    Customer Value
    xyz A1 B2 B1
    AAA C7 A1
    How would I group this into once value ?
    Thanks in advance ...

    Tom's discussion of writing your own aggregate routines
    http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:2196162600402
    starts off with a link to the 8i alternatives
    "see
    http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:229614022562
    for 8i methods (not aggregates)"
    Unforutnately, it's a lot more work in 8i.
    Justin

  • How to turn two users into one?

    Hey there!
    As I selled my MBP last month I copied all its datas to my iMac via migration assistant and created a new user for it. So I have now two accounts with different photos, documents etc.
    My problem now is how to turn these two users into one?
    I want all my photos appear in Aperture of my first user, I want all my documents appear in "Documents" of the first user and so on..
    Is it able? If yes, how could I realize it?
    Thanks for your support!
    René
    PS: 2 Users on iMac -> 1 User on iMac.

    Thanks for your help at first.
    But you usually can't "merge" two "normal" user accounts successfully.  If both accounts have data for the same application, it will be very difficult or impossible to merge them by copying files & folders.
    I cannot merge them.. So there is the question how to copy all medias from Aperture to my other Aperture medias?
    Can I export my whole medias and import in at the other users Aperture? And how? #
    Edit: I dont want to have two different libraries at all.. I want them to be together in just one..

  • How to combine two albums into one

    I imported into iTunes two Shostakovich compositions so that I could burn a CD-R that contained these two works. The CD burning went fine, but iTunes insists on separating the two compositions into two albums in the display of all albums. I have made sure that the album titles and the artists displayed under the album icons are identical, but still the two will not meld into one. Will someone help me with this? I am using iTunes 9.2.1(4).

      On the "Get Information" windows (reached with right clicks) of the two separated albums, one album was marked as "no" on the "part of a compilation" option and the other was marked "yes". I changed the "no" to a "yes" and they merged. I'm not sure if I got this from the site you gave me or if I just stumbled on to it. Either way, I thank you for your kind responses.

  • How to cram two bytes into a short?

    Hi all,
    I have some byte[] data that I am receiving, and I need to put two bytes into one short (or int, or whatever), as the byte[] will form a two bytes-per-pixel image. I've been working with 8-bit data (this is 12-bits, NOT packed), which is much easier to manipulate.
    I currently have this method to convert a byte[] of 8-bit data into a short (I do this because Java does not support signed types and I need that 8th bit):
    private short[] convertBytesToShorts(byte[] data) {
         short[] convertedData = new short[data.length];
         for (int i = 0; i < data.length; i++) {
              convertedData[i] = (short)((short)data[i] & 0xff);
         return convertedData;
    }Is there a way to modify this to place two bytes into one short? Is it possible to just AND two bytes with 0xff and add them together to create one short? Surely it cannot be that simple. Also, remember that I must treat the values as unsigned.
    Furthermore, the two bytes look like this:
    | xxxx xxxx | xxxx 0000 |So the last four bits in the second byte are 0s.
    Any advice is appreciated.
    Message was edited by:
    Djaunl

    I've been working with 8-bit
    data (this is 12-bits, NOT packed), Obviously that is contradictory.
    I currently have this method to convert a byte[] of
    8-bit data into a short (I do this because Java does
    not support signed types and I need that 8th bit):
    Yes it does. The fact that it displays a byte as and integer and the conversion in that process produces a negative display value has nothing at all to do with the bits.
    Is there a way to modify this to place two bytes into
    one short? short s = (short)(((b1 << 8) & 0x0ff) | (b2 & 0x0ff))
    Of course you still have to deal with getting the order correct.
    (You can probably get rid of that first mask but you would need to test that.)

  • Satellite L40-18Z: How to merge two partitions into one partition?

    Hello,
    I have a satellite L40 with a hard disk drive partitioned into two ( C and E ), one having 37GB capacity the other almonst 36 GB.
    The C drive is almost full and the E drive almost empty. I would like to take away the partition and have just one drive, is this possible.
    Any advice would be gratefully received. I am not a techi so be kind.
    Regards
    Peter

    Hi
    Of course this is possible
    You can do this in disk management.
    Just click right on My Computer -> Manage
    Here choose disk management.
    Now you have to delete the E partition. Then the free space could be added to the C partition.
    But note; before you would do this, create the recovery disk (if you didnt this in the past.)

  • How to make two files into one?

    I got two .iso files I would like to make into one file.
    What program can I use for this process? And step-by-step if possible.

    For disk images, if either of them is a read/write image, you can simply mount them both, drag the contents of one into the contents of the other, and unmount again. (Edit: just re-read your post; .ISO files are read-only so you will need to either follow the below instructions, or convert the ISO to a read/write DMG by dragging it into the left panel of Disk Utility and using the Images-Convert menu.)
    If they are both read-only, you'll need to create another disk image to contain them - use Disk Utility for this (File - New - Blank Disk Image), set the required size and properties, and once it's mounted, drag the contents of both .ISO images into it.
    Matt
    Message was edited by: Matt Clifton

  • How to synchronize two Event Dispatcher threads?

    I have two applications running in the same jvm. The flow should go like--
    a) First application (A1) has a swing window containing componets like buttons, text boxes etc.
    b) On click of this button, Event Dispatcher thread (T1) , calls the other application (A2).
    c) The second application A2, creates a swing window using EventQueue.invokeLater method and in the mean time Thread T1 should wait for this new A2 window to get some results from the database.
    Is it possible to stop thead T1 in between without freezing the GUI components of application A2.
    Thanks

    I think what tjacobs01 is getting at, is that there is only one Event Dispatcher Thread per JVM. So your question does not make sense. If there really is two EDT threads, then you are dealing with inter-process communication (since there would be two JVM processes, one for each application).
    It sounds like there is only one JVM, one EDT and two instances of a java.awt.Window. You probably think of the window == an application. In that case, you can probably solve your problem by executing the DB access (the long-running task) in the doInBackground() method of a SwingWorker.
    http://java.sun.com/products/jfc/tsc/articles/threads/threads1.html

  • How to club two rows into one

    hi
    Can we club two rows of a SQL statement into one , that is some column results from one row and other column result from second row, but the row must remain same .
    thanks
    imran

    SQL> with sample as (select 'A' supplier, 1000 total, 0 branch_total from dual
      2                union all
      3  select 'A' supplier, 0 total, 500 branch_total from dual
      4                union all
      5  select 'B' supplier, 300 total, 0 branch_total from dual
      6                union all
      7  select 'B' supplier, 0 total, 120 branch_total from dual)
      8  SELECT SUPPLIER , SUM(TOTAL) , SUM(BRANCH_TOTAL) FROM SAMPLE
      9    GROUP BY SUPPLIER
    10  /
    SUPPLIER SUM(TOTAL) SUM(BRANCH_TOTAL)
    A              1000               500
    B               300               120

  • Any one know how to insert an event into a certain year in Imovie08

    Hi All,
    I am starting to move my D8 movies to my Mac. In Imovie08 Some seem to realize what year the video was shot some don't. It adds by year 2001-2002 etc and puts the movies shot under that event year. My last import went under 2007 even thought it was shot in 2002. When I tried to drag it, it tried to merge with the other video under 2002 instead of being a separate event. Any thoughts?
    GE

    In Imovie08 Some seem to realize what year the video was shot some don't. It adds by year 2001-2002 etc and puts the movies shot under that event year.
    This is normal depending on how the video was digitized, whether or not a "real" DTG Stamp was generated, or whether or not the stamp is "properly" recognized.
    My last import went under 2007 even thought it was shot in 2002. When I tried to drag it, it tried to merge with the other video under 2002 instead of being a separate event. Any thoughts?
    When no stamp exists or is recognized, the "Creation" date is used. Improperly recognized stamps may generate an erroneous date. In either case, the easiest thing to do is change the file creation date. There are several ways to do this but I now tend to prefer a little utility called "A Better Finder Attributes." Just open the application, drop the "iMovie Events" folder file(s) to the "batch" area of the utility, set the date you want, and press "OK" to change their dates. The next time you open iMovie '08, the clips will be in the same folder name but the folder will appear under the calendar year to which you changed the clip file creation dates.

  • How to copy Two universes into a Single universe

    Hi ,
    I am working on SAP BO 3.1 Designer ,
    I have three universes namely A,B& C which are pointing to same data base and with the same connection
    now I would like to combine the universes
    can u please suggest me on this..
    I would like to have the components of Universe A & B. in universe C..
    Thanks In Advance..

    Hi,
    I think, you are asking for the linking of multiple universes into a single universe and this is compatible with SAP BO 3.1 Designer
    Steps to Link Multiple Universes to a Single Universe with same Database and Connection
    1. Create a Universe A (for instance) with proper parameters mentioning the Database and Valid Connections
    2. Go to File >> Parameters >> Links tab and then Click Add Link
    3. Then point the Universe B you wish to link
    4. Similarly add a link to the other Universe C and then export the the Universe after saving to the repository.
    ** These universes are dynamically linked to the universe and the Objects, classes will be made available.
    Thanks and Regards,
    Arul Frances S

Maybe you are looking for

  • Parallel processing of mass data : sy-subrc value is not changed

    Hi, I have used the Parallel processing of mass data using the "Start New Task" . In my function module I am handling the exceptions and finally raise the application specific old exception to be handled in my main report program. Somehow the sy-subr

  • Print module - print to file options

    When creating JPEGs using the Export function of the Library module, Lightroom 4 offers you very detailed control over the export options, including automated rules for the folder/filename structure. When creating JPEGs using "print to file" in the P

  • Few suggestion for WP8 - if at all given a thought

    I have recently upgraded form Nokia N8-00 to Nokia Lumia 925 and immediately noted few very important things missing. 1: I could transfer most of my data from N8-00 to Lumia 925 except calender entries and notes. For me all calender entries and noted

  • Why do Analysis VIs need the full path to lvanlys.dll?

    I've noticed that all Analysis VIs contain the full pathname of the lvanlys.dll that is being called.  This means that the .lvproj file lists this fully qualified DLL filename as a dependency of the project.  This turns out to be an issue if the same

  • How to include microsoft.research.kinect.dll file?

    When trying to activate a demo VI file using xbox kinect, MS-SDK and LabView 2011 we get the announcement that the file "microsoft.research.kinect.dll" is not found. Even after we put it in the relevant directory we got the same message. Does any one