Ad Widget

Collapse

Help with trigger with count

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • andvsilva
    Member
    • Aug 2020
    • 39

    #1

    Help with trigger with count

    Hello everyone.

    I`m having some trouble with trigger with my Zabbix 5.0.

    I create a item to check if the process is running in my CentOS like this:

    Code:
    proc.num[node,,,webserver.coffee]
    So, I create a trigget to check if the process is running and only one process not more than 1.

    -Trigger problem:
    Code:
    {Template_Teste: proc.num[node,,,webserver.coffee].count(#3)}<{$PROC_MIN_DASHMONITOR}
    or {Template_Teste: proc.num[node,,,webserver.coffee].count(#3)}>{$PROC_MAX_DASHMONITOR}
    - Trigger OK:
    Code:
    {Template_Teste: proc.num[node,,,webserver.coffee].last(#1)}={$PROC_MIN_DASHMONITOR}
    This macros:
    {$PROC_MIN_DASHMONITOR} = 1
    {$PROC_MAX_DASHMONITOR} = 1

    I want to check in the last 3 times if the process is running on One unique process.

    Someone can help me?

    I read the documentation in Zabbix Page but I don't figure out what I'm doing wrong.

  • Hamardaban
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • May 2019
    • 2713

    #2
    you not need OK trigger, just PROBLEM with ( max(#3) >1 or min(#3)<1 )

    Comment

    • andvsilva
      Member
      • Aug 2020
      • 39

      #3
      Originally posted by Hamardaban
      you not need OK trigger, just PROBLEM with ( max(#3) >1 or min(#3)<1 )
      All right Hamardaban, thanks. I change my check using one Unique host to check the value in the two other host. But I still need help with my trigger. Because I'm trying to Trigger only after 3 consecutive attempts with failure. But now I'm checking if the return value is 'OK' if the return will different of this I will trigger but only after 3th attempt.

      For example:

      {Template_Teste: proc.num[node,,,webserver.coffee]..count(#3,"^(?!OK).+","regexp")}=3}
      This RegEx "(?!OK).+" I'm using to certify the return value doesn't starts with "OK".

      But I'm certainly doing something wrong.

      Comment

      Working...