Ad Widget

Collapse

trigger that fires on >relative< cpu load change

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bkuhlen
    Junior Member
    • Oct 2012
    • 2

    #1

    trigger that fires on >relative< cpu load change

    Hi there,

    From what I know in a trigger expression the last operand is always a constant.
    So to fire a trigger if the cpu load goes beyond say '5' you can go straightforward:

    {Template_FreeBSD:system.cpu.load[,avg15].last(#10)}>5

    .. would fire if the last 10 cpu-records are higher than '5'

    That might be worth a trigger on a weak and old 1-cpu-machine but on a performant system with 16 or more cores a load of '5' is not worth mentioning.

    Moreover sometimes I encounter zombie processes which will not die and consume cpu resource. For instance: a machine with an average load of 1 rapidly changes its load to 2 and stays there (until I recognize it and kill the process that run mad).

    So my question: is there a possibility to define a trigger that does not have a constant as last operand but a function/variable?

    What I'm actually looking for is someting like this:

    {Template_FreeBSD:system.cpu.load[,avg15].last(#10)}>{Template_FreeBSD:system.cpi.load.avg( #500)+1}

    So it the last 10 records of cpu load are 1 or more higher than the average of the last 500 records, THIS is worth a trigger because this hints to some sort of "abnormal" load signal...

    I guess it's not configurable now ( as of version 1.8.7, how about version 2??)
    Any workaround to achieve something "similar"? I want to track "abnormal cpu signals that might be due to processes running mad"

    Are there known plans to implement such a feature in the future?

    Best regards,
    Bernd
  • bkuhlen
    Junior Member
    • Oct 2012
    • 2

    #2
    I think I found a solution myself ;-)

    Having a constant as last operator is not a problem of course if you have the idea of putting both operand on the left side of the equation ;-)

    Here's my current trigger and it seems it's doing the job nicely. Only problem is that the trigger switches to OK, once the "higher load" is in most of the 500 last values...

    {Template_FreeBSD:system.cpu.load[,avg15].min(#250)}-{Template_FreeBSD:system.cpu.load[,avg15].avg(#500)}>1

    Comment

    Working...