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?
Regards,
Tim
Risto Vaarandi wrote:
Tim,
you could tackle the problem in several ways.
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
type=Single
ptype=RegExp
pattern=MAINT_CONTEXT_FOR_(\d+)
desc=create maintenance context for $1 seconds
action=create MAINT_CONTEXT $1
Another (and perhaps simpler) way of addressing the problem would be
to create a temporary context with the lifetime of $1 seconds in the
first rule, which would create MAINT_CONTEXT with a lifetime of $2
from its action-on-expire list. In that case you only have one rule,
and if you are afraid of losing state between restarts, SEC can be
easily configured to store/reload its contexts to/from disk at
shutdown/restart (see a 5 year old post from the mailing list:
http://sourceforge.net/mailarchive/message.php?msg_id=4177CC7F.7080002%40eyp.ee).
On the other hand, 'tevent' creates a separate synthetic event that
can be matched by other rules as well, and its use is more convenient
if you would like to set up several event processing rules for
maintenance window creation.
hth,
risto
On 12/03/2009 02:23 PM, Tim Peiffer wrote:
I have been running SEC as a method to front-end trouble ticketing via
HP ServiceCenter. One of the problems I have not figured out is how to
dynamically schedule context creation so that I can bypass the ticket
creation if there is a known maintenance window. I have very little
clue on how to develop a dynamic scheduler in SEC. I am looking for
ideas; has this problem already been tackled? I am thinking that I
might be able to employ the perl module Schedule::At
(http://search.cpan.org/~joserodr/Schedule-At-1.08/At.pm), but that may
not be necessary. I think that the actual maintenance window should be
sent through the event stream.
Lets say that there is a known maintenance window on a particular device
(router, switch). I would like to do a search of the network topology
starting at the device that the maintenance window is declared, and
create a context for each one of the managed devices below that point.
The context creation should have a defined date/time of birth, and a
defined life time.
Regards,
Tim
--
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
___
Simple-evcorr-users mailing list
Simple-evcorr-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/simple-evcorr-users