[email protected] wrote:
> Hi,
> 
> I am new to SEC.
> 
> I like to run a monitoring script every 5 min wit calendar rule:
> 
> # call monitorscript
> type=Calendar
> time=5,10,15,20,25,30,35,40,45,50,55 * * * *
> desc=TESTMON
> action=spawn /opt/local/eventscripts/TESTMON.cmd
> 
> /opt/local/eventscripts/TESTMON.cmd is called also at startup of sec.pl
> As well as at the secified times.
> 
> The application and sec.pl are started at system startup from rc.local.
> The application may take a few minutes to startup, and will not be
> available 
> Immediately, so TESTMON.cmd would give a false alarm.
> 
> Is there a way not to run the script at startup?

yes, there is -- start SEC with the -intevents option, e.g.,

sec-2.5.1/sec.pl -conf=SEC-misc/test.conf -input=- -intevents

This will generate SEC_STARTUP internal event when SEC starts up. In 
your rule file, you can match this event and create a context for 3-5 
minutes which turns the Calendar rule off temporarily. Here are two 
rules for implementing this idea:

type=Single
ptype=SubStr
pattern=SEC_STARTUP
context=SEC_INTERNAL_EVENT
desc=create a context for indicating that application startup takes 180 
seconds
action=create APPLICATION_STARTUP_IN_PROGRESS 180

type=Calendar
time=5,10,15,20,25,30,35,40,45,50,55 * * * *
context=!APPLICATION_STARTUP_IN_PROGRESS
desc=TESTMON
action=spawn /opt/local/eventscripts/TESTMON.cmd

hth,
risto

> 
> Thank for your help
> 
> Uwe
> 
> 
> ------------------------------------------------------------------------------
> Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT 
> is a gathering of tech-side developers & brand creativity professionals. Meet
> the minds behind Google Creative Lab, Visual Complexity, Processing, & 
> iPhoneDevCamp as they present alongside digital heavyweights like Barbarian 
> Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com 
> _______________________________________________
> Simple-evcorr-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/simple-evcorr-users
> 


------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT 
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian 
Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com 
_______________________________________________
Simple-evcorr-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/simple-evcorr-users

Reply via email to