Ad Widget

Collapse

[Help] Trigger only after 3 attemps

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

    #1

    [Help] Trigger only after 3 attemps

    Hi,

    I'm new in Zabbix and I need help to understand the trigger, because when I test in trigger page works well, but when I put in my env doesn't work, I don't know what to do, I need to solve it.

    Example
    - I have the check in IDRAC for Controller
    - The OK value is 3

    Then, I need to check the last 3 attempts if is different of 3.

    I tried a lof of changes and nothing work, the trigger always run after first attempt.

    My actual configuration is:

    -- Problem Expression:
    Code:
    ({TD03_IDRAC:RAIDControllerStatus.last(#2)}<>3 and {TD03_IDRAC:RAIDControllerStatus.last(#1)}<>3 and {TD03_IDRAC:RAIDControllerStatus.last()}<>3)
    -- Recovery Expression:
    Code:
    ({TD03_IDRAC:RAIDControllerStatus.last(#2)}=3 and {TD03_IDRAC:RAIDControllerStatus.last(#1)}=3 and {TD03_IDRAC:RAIDControllerStatus.last()}=3)
    But I don't like because it is too extensive and doesn't work as I expected. So I tried:

    -- Problem Expression:
    Code:
    {TD03_IDRAC:RAIDControllerStatus.count(#3,9,gt)} > 9 or {TD03_IDRAC:RAIDControllerStatus.count(#3,9,lt)} < 9
    -- Recovery Expression:
    Code:
    {TD03_IDRAC:RAIDControllerStatus.count(#3m,9,eq)} = 9
    Someone can help me please? I don't know what to do, I really don't know, because I read the doc: 1 Supported trigger functions [Zabbix Documentation 5.2] and don't understand why doesn't work.
  • Markku
    Senior Member
    Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
    • Sep 2018
    • 1781

    #2
    Hi, note that last() is the same as last(#1), as documented in the doc you linked, so you need to rewrite your "triple-last" trigger. You don't have to configure the recovery expression manually.

    Alternatively you can try "max(#3) <> 3 and min(#3) <> 3".

    Markku

    Comment

    • andvsilva
      Member
      • Aug 2020
      • 39

      #3
      Thanks Markku it works as I needed. Thank you so much, maybe there is other ways, but for now is good.

      I read the doc about Min and Max and the idea is:

      - Min: Will trigger if the last 3 values is lower than 3
      - Max: Will trigger if the last 3 values is higher than 3

      Well, I really appreciate your help. Just one question, this will better if put 'OR' instead 'AND' correct?

      I tested in trigger page and works in the both ways. I will do some test to check if works, but what do you think about? I have some difficult to understand the zabbix trigger, when I test in page of trigger (zabbix administration page) it work, but when I test in item (normal thinks for example) doesn't work as I expected.
      Last edited by andvsilva; 28-06-2021, 15:00.

      Comment

      • Markku
        Senior Member
        Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
        • Sep 2018
        • 1781

        #4
        Originally posted by andvsilva
        - Min: Will trigger if the last 3 values is lower than 3
        - Max: Will trigger if the last 3 values is higher than 3
        min() is the minimum of the provided values (= result is a number), and max() is the maximum accordingly. Example: if the last three values are 3, 2 and 3, then min(#3) is 2 and max(#3) is 3.

        Originally posted by andvsilva
        Well, I really appreciate your help. Just one question, this will better if put 'OR' instead 'AND' correct?
        You are correct, my mistake, OR is the correct one here, sorry for any confusion. Yes, it needs to trigger if either the minimum is not 3 OR the maximum is not 3.

        Markku

        Comment

        Working...