Hi Risto,

I thought 2 ways:

First, create from batch a signal support file that it is going to be
checked with a perl function in a calendar rule. Also batch file is going
to be launched from a calendar rule.Resetrules.conf is going to control the
process.

I modified the diagram to accomplish the problem and understand the scene.

https://drive.google.com/file/d/0BzGAeQ7Jnta6QnI1RE5tY1ZXa3c/view?usp=sharing

Note:Rules1.conf-->Rules2.conf-->Rules3.conf-->Rules4.conf use a JUMP rule.
I don´t have any restriction of log reading in my rules.

With this method the problem that i have is sec just launch one of the
rules not the other when the time is passed.


launchBat.bat(Creates a file with 1 line, event)
____________________________________________________________________
echo|set /p=restartAlert>C:\signal.txt


type=Calendar
time= 2 * * * *
desc=Execute_bat
action= shellcmd  C:\launchBat.bat;

type=Calendar
time= * * * * *
desc=Check_File
action= eval %o (if (-e 'C:\signal.txt'){print "\nExists!!!!\n";});
rem Function to check file.Here from perl function launch another bat kill
the process and restarting sec.

In this case i tested and sec doesn´t launch "Execute_bat" rule and the
other one too, just when i change time variable to * * * * * and the second
rule in this case doesn´t launch.


Second, I was reading the sec manual and i thought something like this:

launchBat.bat
____________________________________________________________________
echo restartAlert-->i generated reload event as input

type=Calendar
time= * * * * *
desc=Execute_bat
action=spawn C:\launchBat;

type=single
continue=takenext
ptype=regexp
desc=reload_rule
pattern=.*restartAlert.*
action=lcall %o -> (sub{$main::refresh = 1;})

Which is the diference between spawn and cspawn?Is it possible to use like
that to simulate the signal and capture from the bat?

I tested this way but i have no result.No rules launched.

Time in the rules is supposed to 30min but i just set up to 2 min to see
the events generated.

Thank you Risto. Regards.





2016-06-27 10:50 GMT+02:00 Risto Vaarandi <risto.vaara...@gmail.com>:

> hi,
> as I understand, the problem is the following -- the RELOAD event that you
> have generated does not reach the second rule in resetRules.conf? If you
> are using a hierarchical ruleset with Jump rules, please make sure that the
> RELOAD event is directed to resetRules.conf.
>
> Also, your ruleset has one subtle caveat. Your first rule has the
> following action list:
>
> action= shellcmd C:\launchBat.bat;event RELOAD;
>
> Please note that command lines triggered by 'shellcmd' action are always
> executed asynchronously and sec will *not* wait for the completion of
> command lines, but would rather continue processing input events (the
> status of the command line is checked by sec after short time intervals,
> until the command line has completed). Therefore, the following actions in
> your rule will essentially run in parallel:
>
> shellcmd C:\launchBat.bat
> event RELOAD
>
> It is quite likely that the RELOAD event is generated *before*
> C:\launchBat.bat has completed its work, and therefore rules are reloaded
> before the command line has accomplished its task.
>
> If the order of the above two actions is important for you and the first
> action needs to finish before the second action is started, some
> synchronization mechanism needs to be developed between these two actions.
> For example, you could produce an event from the end of C:\launchBat.bat
> which is written into SEC input, and which will trigger the rule reloading
> procedure.
>
> kind regards,
> risto
>
>
> 2016-06-27 11:15 GMT+03:00 Jaren Peich <burkol...@gmail.com>:
>
>> Hi Risto,
>>
>> I have a SEC running doubt referring sec restart rules. I have the
>> following graph attached to the email.
>>
>> Scene:
>> I start reading logs and launching rules as normal, while i´m doing the
>> process i want to restart sec to download a list and load the list
>> generated in iniLib in the hash table. Batch file is working properly. The
>> problem is the system doesn´t stop and refresh the rules when the time have
>> been spent the time. Have i assign reset rule each file?Can i do globally?
>>
>>
>> resetRules.conf
>> _____________________________________________________________________
>> type=Calendar
>> time= 58 * * * *
>> desc=Download_Rule_List
>> action= shellcmd C:\launchBat.bat;event RELOAD;
>>
>> type=single
>> ptype=regexp
>> pattern=.*
>> desc=reload_hash
>> action=lcall %o -> (sub{$main::refresh = 1;})
>>
>> Thank you Risto. Regards.
>>
>>
>>
>
------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
Simple-evcorr-users mailing list
Simple-evcorr-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/simple-evcorr-users

Reply via email to