On Apr 4, 2012, at 1:34 PM, Makewise - Vitor Rui Mendonça wrote:

> One possible solution is to modify trapd/eventd in order to set the timestamp 
> of the received trap/event, in order to create events with past timestamp.
> Before testing this, we want to ask you the following:
> is this the best approach?
> Is there any semantic-rule in the code that could prevent to do this, like:
> if (eventA.eventId < eventB.eventId) then it's supposed (eventA.eventtime < 
> eventB.eventTime)



Even if you were able to create the event into the past, the poller is going to 
detect the outage at the time it polls.  The only way to work around this is to 
write an automation:

Trigger:

SELECT o.svclosteventid as "_outageid", e.eventtime as "_actualoutagetimestamp"
  FROM outages o
  JOIN events e
    ON e.eventid = o.svclosteventid
 WHERE o.iflostservice - e.eventtime > interval '10 seconds'


Action:

UPDATE outages o
   SET o.iflostservice = e.eventtime
 WHERE o.outageid = ${_outageid}


That's probably not perfect and is dependent on the ability to set the event 
time to the actual time the Trap was sent.  I should think that this is 
possible with the ET.  However, I positive that you can't set the 
eventcreatetime field for the EventBuilder will fix it to the time the Event is 
created regardless of you setting the field (well, I 90% positive ;)



David Hustace
The OpenNMS Group, Inc.

+1 919 533 0160 x7734
david_opennms (skype to my direct line)
      '\                   .  .                        |>
        \              .         ' .                   |
       O>>         .                 'o                |
        \       .                                      |
        /\    .                                        |
       / /  .'                                         |
 ^^^^^^^`^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
Please read the OpenNMS Mailing List FAQ:
http://www.opennms.org/index.php/Mailing_List_FAQ

opennms-devel mailing list

To *unsubscribe* or change your subscription options, see the bottom of this 
page:
https://lists.sourceforge.net/lists/listinfo/opennms-devel

Reply via email to