Code Monkey home page Code Monkey logo

Comments (7)

basvandervlies avatar basvandervlies commented on September 15, 2024

This is just an example. we use this to klll user processes that consume to much resources on our login nodes. This code must be run on compute nodes.

bundle agent sara_user_consume_resources(minutes, memory, exclude)
{
    processes:
        any::
            ".*"
                comment         => "Kill processes that use to much resources",
                signals         => { "term", "kill"},
                action          => sara_action,
                process_select  => sara_user_consume_resources_select("$(minutes)", "$(memory)", @(exclude));
}

##
# Kill processes that uses too much cpu time or memory and exclude
# important users
#
body process_select sara_user_consume_resources_select(minutes, memory, owners)
{
    command        => "ssh.*|scp.*|rsync.*|cp.*|mv.*|tar.*|gzip.*|bzip2.*";
    process_owner   => { @(owners) };
    ##
    # Bug in ps parsing minutes are seconds. so use the hour field for minutes
    # ttime_range     => irange(accumulated(0,0,0,"$(minutes)",0,0), accumulated(1,0,0,0,0,0));
    ttime_range     => irange(accumulated(0,0,0,0,"$(minutes)",0), accumulated(1,0,0,0,0,0));
    #
    rsize           => irange("$(memory)", 'inf');
    process_result  => "(ttime|rsize).!(process_owner|command)";
}

from evolve_cfengine_freelib.

neilhwatson avatar neilhwatson commented on September 15, 2024

@basvandervlies Is there a bug report for that time parsing problem?

from evolve_cfengine_freelib.

basvandervlies avatar basvandervlies commented on September 15, 2024

@neilhwatson this is fixed a long time ago. I must remove this statement. There is a bug report and pull request:

from evolve_cfengine_freelib.

neilhwatson avatar neilhwatson commented on September 15, 2024

@basvandervlies I think this bug is still true or the verbose output is off:
snmp 2728 1 0 Aug22 ? 00:02:19 /usr/sbin/snmpd

verbose: P: Container path : '/default/main/processes/'/usr/sbin/snmpd.:'[0]' verbose: P: verbose: P: Comment: Set kill class if count too high verbose: P: ......................................................... verbose: verbose: Selection filter matched counter range 'TIME/TIME' = '00:02:19' in [60,999999999] (= 139 secs)

from evolve_cfengine_freelib.

basvandervlies avatar basvandervlies commented on September 15, 2024

Ok, i have the source for 3.6 and check it against the 3.7 version

On 24 aug. 2015, at 19:44, Neil H Watson [email protected] wrote:

@basvandervlies I think this bug is still true or the verbose output is off:
snmp 2728 1 0 Aug22 ? 00:02:19 /usr/sbin/snmpd

verbose: P: Container path : '/default/main/processes/'/usr/sbin/snmpd.:'[0]'
verbose: P:
verbose: P: Comment: Set kill class if count too high
verbose: P: .........................................................
verbose:
verbose: Selection filter matched counter range 'TIME/TIME' = '00:02:19' in [60,999999999](= 139 secs)


Reply to this email directly or view it on GitHub.


Bas van der Vlies
| Operations, Support & Development | SURFsara | Science Park 140 | 1098 XG Amsterdam
| T +31 (0) 20 800 1300 | [email protected] | www.surfsara.nl |

from evolve_cfengine_freelib.

neilhwatson avatar neilhwatson commented on September 15, 2024

https://dev.cfengine.com/issues/7516

from evolve_cfengine_freelib.

neilhwatson avatar neilhwatson commented on September 15, 2024

new bug https://tracker.mender.io/browse/CFE-2115?jql="External%20issue%20id"~"7516"

from evolve_cfengine_freelib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.