Ad Widget

Collapse

Question about creating a trigger under certain conditions with the count expression.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Jean_27
    Junior Member
    • Feb 2025
    • 1

    #1

    Question about creating a trigger under certain conditions with the count expression.

    Hello everyone i am not sure if anyone can help me with this, i am having quite trouble creating a trigger.

    Currently i have an item that shows the current consumption of the CPU in percentage and i want to create a trigger using said item, i am wondering if there is any way to create trigger that activates when for example the consumption of the CPU supasses 85% more than one times in an specific interval of time let's say 90 minutes, i tried using this trigger expression, count(/server/CPCpuUsage,90m,"gt",85)>1 but it's not working as i expected because it triggers when the threshold is surpassed more than one time during an interval of 90 minutes but i have to wait another 90 minutes for it to deactivate, i even tried using this recovery expression count(/server/CPCpuUsage,10m,"lt",85)>=2 but it still will not be applied until 90 minutes have elapsed without exceeding the threshold, is there any way to create an alert that is triggered by the above conditions but it deactivats after 10 minutes have elapsed since the threshold has not been exceeded? Another way i was trying was to use this trigger last(/server/CPCpuUsage)>85 to make another trigger counting how many times it activates in a row but i am not sure if it's possible.

    Sorry if some parts are not very well understood I tried to explain my case the best I could, I hope someone can help me, thanks in advance.
  • cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4807

    #2
    Calculation window is moving window (now- defined time period) and recalculation appears, when new value arrives. So yes, until your 90m time window contains more than 1 value, higher than 85, trigger stays in problem state. Recovery expression will not help, as it is additional criteria, what is looked at only aftger initial expression has already become false.
    I fail to find a suitable expression here, which would activate right away based on last 90m, but deactivate in 10 minutes... those 2 timeframes do not work together... It will delay triggering at least 10 minutes from last high value ( ... and count(/server/CPCpuUsage,10m,"gt",85)=0) and then all the 90m interval loses any point..
    So the logic behind all this escapes me...

    Comment

    Working...