In message <[email protected]>,
Tim Peiffer writes:
>Risto Vaarandi wrote:
>> First, there is a way to implement at-like functionality dynamically
>> in SEC through the 'tevent' action (it's the most recently added
>> action that appeared in version 2.4.2).
>> The 'tevent' action generates a synthetic event after given amount of
>> seconds, and the number of seconds can be a variable. Since you said
>> that you would like to provide the size of the maintenance window via
>> the event stream, you could augment that event with the number of
>> seconds that have remained to the beginning of the maintenance window.
>> You could then use Single rule for catching that event which triggers
>> the actual context creation via 'tevent':
>> [...]
>> type=Single
>> ptype=RegExp
>> pattern=MAINTENANCE AFTER (\d+) sec FOR (\d+) sec
>> desc=trigger the creation of maintenance context \
>> after $1 seconds with a lifetime of $2 seconds
>> action=tevent $1 MAINT_CONTEXT_FOR_$2
>>[...]
>I think you have addressed part of what I am asking. Using you as a
>sounding board - So if I read a ticket and create a log event
>"myhost.mydomain Maintenance window scheduled 200912090800 for 3600
>seconds", would I need to parse the start time, and compare to <now>,
>and use that delta in the tevent?
That's how I read it. You can use eval to call the parsing
routine. Something like:
eval %{deltatime} (mydeltatime($1);); tevent %{deltatime} \
MAINT_CONTEXT_FOR_$2
If you use a time_t for your starting time, then mydeltatime is:
return ($1 - time)
--
-- rouilj
John Rouillard
===========================================================================
My employers don't acknowledge my existence much less my opinions.
------------------------------------------------------------------------------
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
_______________________________________________
Simple-evcorr-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/simple-evcorr-users