Ad Widget

Collapse

Need help adjusting the trigger

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • igalsc
    Junior Member
    • Jan 2021
    • 20

    #1

    Need help adjusting the trigger

    Hello fellow Zabbix users,
    I have another question, hope you would be able to help me here.
    I'm on Zabbix 5.2
    I'm trying to alert whenever our APIs are slow to response (i.e., response time higher than 3 sec).
    I have this configuration in the Problem Expression:
    Code:
    {Analytics API 3.x PROD:web.test.time[Analytics API 3.x PROD,Analytics API 3.x PROD,resp].last(#1,1)}>=3
    However, I got these alerts as a problem today:
    Analytics API 3.x PROD response time is 1s 332ms

    According to this post https://www.zabbix.com/forum/zabbix-...-response-time, web.test.time>=3 should be treated as higher or equal to 3 seconds, but I get alerted on a way lower response time

    Thanks ahead,
    Igal
    Last edited by igalsc; 08-01-2021, 20:33.
  • igalsc
    Junior Member
    • Jan 2021
    • 20

    #2
    Today I got alerts about response time of 1.6sec
    can anyone enlighten me, please?

    Comment

    • igalsc
      Junior Member
      • Jan 2021
      • 20

      #3
      Originally posted by cyber
      Why are you using time shift (second parameter for last())? In this case you are triggering one check later and most probably displaying latest value in event? Just out of curiosity... check if the previous value was more than 3sec...
      Good question. So, based on what you just asked, I should be doing
      Code:
      {Analytics API 3.x PROD:web.test.time[Analytics API 3.x PROD,Analytics API 3.x PROD,resp].last(#1)}>=3
      ?

      Comment

      • igalsc
        Junior Member
        • Jan 2021
        • 20

        #4
        Originally posted by cyber
        Yes, if you want it based on last value, then last(#1) or just last().
        Thank you, cyber !

        Comment

        • igalsc
          Junior Member
          • Jan 2021
          • 20

          #5
          I'm still confused

          I have a trigger with the following config:
          Name {HOST.NAME} response code
          Operational Data {HOST.NAME} response code is {ITEM.LASTVALUE}
          Problem Expression {FTR Twitter:web.test.rspcode[FTR Twitter,FTR Twitter].last()}<>200
          Recovery expression {FTR Twitter:web.test.rspcode[FTR Twitter,FTR Twitter].last()}=200

          It triggers as Problem: FTR Twitter response code, with Opdata FTR Twitter response code is 200

          When I check the trigger, it's state is OK, but it was fired, and it stays "unresolved" in terms of alerts
          What is wrong with my trigger configuration?

          Thanks ahead
          Igal

          Comment

          • yurtesen
            Senior Member
            • Aug 2008
            • 130

            #6
            You do not need a recovery expression. Because you are checking if last value is NOT 200. It will recover automatically if last value is 200. Anyway...
            Click on the Time index on the unresolved event and open Event Details and check operational data. If it makes no sense, send screenshot.

            Comment

            • igalsc
              Junior Member
              • Jan 2021
              • 20

              #7
              Originally posted by yurtesen
              You do not need a recovery expression. Because you are checking if last value is NOT 200. It will recover automatically if last value is 200. Anyway...
              Click on the Time index on the unresolved event and open Event Details and check operational data. If it makes no sense, send screenshot.
              I do want to receive a notification when the issue is resolved, that's why I do put the recovery expression.

              As for the trigger - it kind of makes no sense to me. It triggers "problem" with response code 200

              Click image for larger version  Name:	Screen Shot 2021-01-18 at 10.41.53 AM.png Views:	7 Size:	651.0 KB ID:	416965
              Last edited by igalsc; 18-01-2021, 19:53.

              Comment

              • yurtesen
                Senior Member
                • Aug 2008
                • 130

                #8
                Your event is resolved. Your screenshot says "Resolved by: Trigger"
                Also your screenshot is missing the "Event List [Previous 20]" section
                See:https://www.zabbix.com/documentation...iewing_details
                If your event was NOT resolved, there would not be a "Resolved by" section.
                You said event stays unresolved. Where do you see "unresolved"?

                Whether you receive recovery information or not does not depend on the trigger recovery expression. It is just a recovery expression for a trigger. The messages are adjusted from Actions.
                Last edited by yurtesen; 19-01-2021, 18:15.

                Comment

                • igalsc
                  Junior Member
                  • Jan 2021
                  • 20

                  #9
                  Originally posted by yurtesen
                  Your event is resolved. Your screenshot says "Resolved by: Trigger"
                  Also your screenshot is missing the "Event List [Previous 20]" section
                  See:https://www.zabbix.com/documentation...iewing_details
                  If your event was NOT resolved, there would not be a "Resolved by" section.
                  You said event stays unresolved. Where do you see "unresolved"?

                  Whether you receive recovery information or not does not depend on the trigger recovery expression. It is just a recovery expression for a trigger. The messages are adjusted from Actions.
                  https://www.zabbix.com/documentation...ration/actions
                  Thank you for your replies.
                  When I'm saying the event seem to be not resolved I mean I do not see it in the notifications. Here are two examples of resolved vs unresolved notifications in Slack

                  Click image for larger version

Name:	Screen Shot 2021-01-20 at 1.23.25 PM.png
Views:	633
Size:	75.6 KB
ID:	417118Click image for larger version

Name:	Screen Shot 2021-01-20 at 1.23.15 PM.png
Views:	637
Size:	58.9 KB
ID:	417119

                  I do want to receive the actual response code at the time the alert is triggered.
                  I also want to receive notification when the response code is back to normal (200 in this case).


                  As a side note - what does the "(UNKNOWN)" stand for here? What field is it looking for?

                  Comment

                  • yurtesen
                    Senior Member
                    • Aug 2008
                    • 130

                    #10
                    Well now you did not mention Slack at all before. It is a very different problem than what you explained before.

                    See Slack related documentation:
                    https://www.zabbix.com/documentation...ications/media

                    You can also choose between two notification modes:
                    • alarm (default)
                      • Update messages will be attached as replies to Slack message thread
                      • Recovery message from Zabbix will update initial message
                    • event
                      • Recovery and update messages from Zabbix will be posted as new messages
                    I think you want the 2nd type....

                    Normally where it says UNKNOWN, there is the IP address of the interface/host. Again, you should check the Slack configuration. All the information you need is there and you can adjust the messages any way you want. See the "script" which is used for Slack media type.
                    Code:
                    {
                    title: 'Host',
                    value: '{0} [{1}]'.format(params.host_name, params.host_ip),
                    short: true
                    }

                    Comment

                  • cyber
                    Senior Member
                    Zabbix Certified SpecialistZabbix Certified Professional
                    • Dec 2006
                    • 4807

                    #11
                    Why are you using time shift (second parameter for last())? In this case you are triggering one check later and most probably displaying latest value in event? Just out of curiosity... check if the previous value was more than 3sec...

                    EDIT: My posts here are out of sequence due to human error and restoring of posts, try to fit them between other posts in thread, you should get a bit more clear picture.
                    Last edited by cyber; 05-04-2021, 08:23.

                    Comment

                    • cyber
                      Senior Member
                      Zabbix Certified SpecialistZabbix Certified Professional
                      • Dec 2006
                      • 4807

                      #12
                      Yes, if you want it based on last value, then last(#1) or just last().

                      Comment

                      • cyber
                        Senior Member
                        Zabbix Certified SpecialistZabbix Certified Professional
                        • Dec 2006
                        • 4807

                        #13

                        Having no recovery expression does not mean, that you are not getting notification when problem is resolved.

                        You are using {ITEM.LASTVALUE} in Operational data field...
                        https://www.zabbix.com/documentation...iggers/trigger
                        Operational data Operational data allow to define arbitrary strings along with macros. The macros will resolve dynamically to real time data in MonitoringProblems. While macros in the trigger name (see above) will resolve to their values at the moment of a problem happening and will become the basis of a static problem name, the macros in the operational data maintain the ability to display the very latest information dynamically.

                        Comment

                        Working...