Bas :)

just remove action modifier. Warning action means do nothing, just
warn. If you remove the modifier, both warning and signal will be
produced.

2010/11/16 Bas van der Vlies <b...@sara.nl>:
> On 15-11-10 15:31, Bas van der Vlies wrote:
>> version: cfengine community 3.1.0
>>
>> when i process is killed in cfengine 3 we only see the pid:
>> {{{
>> cf3  !! Process count for '.*' was out of promised range (1 found)
>> cf3 I: Made in version '1.2.0' of
>> '/var/lib/cfengine3/inputs/lisa/quarterly.cf' near line 20
>> cf3 I: Comment: Kill processes that use to much resources
>>
>> cf3  ->  Signalled 'term' (15) to observed process match '30255'
>> cf3  ->  Signalled 'kill' (9) to observed process match '30255'
>> cf3  ->  No restart promised for .*
>> R: There are user procesees that consume too much
>> }}}
>>
>> in cfengine 2 we see the whole match:
>> {{{
>> cfengine:login3: Signalled process 19558 (.*) with SIGKILL
>> cfengine:login3: Killed: cedricm  19558 24.6 13.1 2181584 2167444 pts/28 R+
>>    15:20   0:05 cresuint
>> }}]
>>
>> So we can contact the user and know which program is executed. Is this
>> possible with cf3?
>
> when i defined an body action for the processes :
>
> processes:
>     LOGIN_HOST::
>        ".*"
>          comment         => "Kill processes that use to much resources",
>          signals         => { "term", "kill"},
>          process_count   => check_range("user_procs", "0", "0"),
>          action          => sara_action,
>          process_select  => sara_user_consume_resources("15",
> "1073741824", @(exclude_owners));
>
>
> body action sara_action
> {
>  action_policy   => "warn";
> }
>
> ====================================
>
> I get the desired output result, but the process is not killed:
> {{{
>  !! Matched: bas      11589 99.7  0.0    100    16 pts/3    R+   10:22
> 10:22 burnP6
> Process alert: USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START
> TIME COMMAND
> Process alert: bas      11589 99.7  0.0    100    16 pts/3    R+   10:22
> 10:22 burnP6
>  !! Process count for '.*' was out of promised range (1 found)
> I: Made in version '1.2.0' of '/var/lib/cfengine3/inputs/lisa/quarterly.cf'
> near line 21
> I: Comment: Kill processes that use to much resources
> }}}
>
> Maybe a new action_policy: fixandwarn.
>
>
> --
> ********************************************************************
> *  Bas van der Vlies                    e-mail: b...@sara.nl       *
> *  SARA - Academic Computing Services   Amsterdam, The Netherlands *
> ********************************************************************
> _______________________________________________
> Help-cfengine mailing list
> Help-cfengine@cfengine.org
> https://cfengine.org/mailman/listinfo/help-cfengine
>



-- 
SY, Seva Gluschenko.
_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to