Ad Widget

Collapse

PATCH: Temporal Displacement, 3 new trigger funcs

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • James Wells
    Senior Member
    • Jun 2005
    • 664

    #1

    PATCH: Temporal Displacement, 3 new trigger funcs

    Greetings,

    The attached patch provides 3 new trigger functions;
    1. AVGTD -- This function compares the current value to the average value, time shifted 24 hours ago. The parameter is the same as the AVG function. i.e. avgtd(300) will compare the current value to the 5 minute average, 24 hours ago and avgtd(#5) will compare the current value to the average of the last 5 values, 24 hours ago.
    2. MINTD -- This function compares the current value to the minimum value, time shifted 24 hours ago. The parameter is the same as the MIN function. i.e. mintd(300) will compare the current value to the 5 minute minimum, 24 hours ago and mintd(#5) will compare the current value to the minimum of the last 5 values, 24 hours ago.
    3. MAXTD -- This function compares the current value to the maximum value, time shifted 24 hours ago. The parameter is the same as the MAX function. i.e. maxtd(300) will compare the current value to the 5 minute maximum, 24 hours ago and maxtd(#5) will compare the current value to the maximum of the last 5 values, 24 hours ago.

    Please note that this patch is against 1.1.6, and affects both the PHP UI and the Zabbix Server source code.

    I am currently working on three variants on these as well: ???TW, which will compare the value against each 24 hour shifts for the last seven days, ???TM, which will compare the value against each of the 24 hour shifts for the last 30 days, ???TWD, which will compare the value against the shift 7 days ago, and ???TMD, which will compare the value against the shift 30 days ago.

    EDIT: Actually, instead of doing 30 days for the month shifts, I think 28 days will work better as that will compare the value against the same weekday to better support daily patterns.

    EDIT2: New patch uploaded that changes these to use the trends table per Alexei's request. Additionally, these new functions will make adding to them much easier in the future.
    Attached Files
    Last edited by James Wells; 19-02-2007, 23:43.
    Unofficial Zabbix Developer
  • Alexei
    Founder, CEO
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Sep 2004
    • 5654

    #2
    Hi James,

    Thanks for the patch. Please give us a couple of examples when (in what situations) the new functions can be used.
    Alexei Vladishev
    Creator of Zabbix, Product manager
    New York | Tokyo | Riga
    My Twitter

    Comment

    • James Wells
      Senior Member
      • Jun 2005
      • 664

      #3
      Quite a few situations where these can be used. Almost every system you will ever monitor will develop a daily, weekly, monthly pattern (trend) of resource utilization. Currently, in Zabbix, it is not really possibly to compare, for example, the current CPU utilization of a web server, against the average CPU utilization from the day before. These trends, while visible in the graphs, are not testable at present in Zabbix.

      One example of usage;
      Code:
      ({HOSTNAME:custom.apache[active].maxtd(300)}<{HOSTNAME:custom.apache[active].last(0)})|({HOSTNAME:custom.apache[active].mintd(300)}>{HOSTNAME:custom.apache[active].last(0)})
      This will trigger an alert if the current number of active connections is greater than the 5 minute max, or less than the 5 minute minimum for the same time yesterday.
      Unofficial Zabbix Developer

      Comment

      • Alexei
        Founder, CEO
        Zabbix Certified Trainer
        Zabbix Certified SpecialistZabbix Certified Professional
        • Sep 2004
        • 5654

        #4
        Please modify this patch to use table 'trends'. The table will work much more efficient comparing to busy history*. Thanks.
        Alexei Vladishev
        Creator of Zabbix, Product manager
        New York | Tokyo | Riga
        My Twitter

        Comment

        • James Wells
          Senior Member
          • Jun 2005
          • 664

          #5
          Originally posted by Alexei
          Please modify this patch to use table 'trends'. The table will work much more efficient comparing to busy history*.
          Done, patch has been replaced with the change you requested and made more efficient at the same time.
          Unofficial Zabbix Developer

          Comment

          • kloczek
            Senior Member
            • Jun 2006
            • 1771

            #6
            Originally posted by James Wells
            Done, patch has been replaced with the change you requested and made more efficient at the same time.
            Sorry .. where is this patch ?

            kloczek
            http://uk.linkedin.com/pub/tomasz-k%...zko/6/940/430/
            https://kloczek.wordpress.com/
            zapish - Zabbix API SHell binding https://github.com/kloczek/zapish
            My zabbix templates https://github.com/kloczek/zabbix-templates

            Comment

            • James Wells
              Senior Member
              • Jun 2005
              • 664

              #7
              Attached to the first post in the thread.
              Unofficial Zabbix Developer

              Comment

              • amit.gaur
                Junior Member
                • Jun 2009
                • 3

                #8
                Are these patches supposed to be independent of the version of Zabbix?
                I have a 1.6 zabbix installation . Do i need to add these patches or are they already a part of the 1.6 build?

                I tried using AVGTD in a trigger and it say unrecognized function so i guess i need to add them?

                Just want to confirm

                Thanks

                Comment

                • nelsonab
                  Senior Member
                  Zabbix Certified SpecialistZabbix Certified Professional
                  • Sep 2006
                  • 1233

                  #9
                  It's likely the patch will not work against 1.6 without some work.

                  You can try to see if James can update it, but it's not that likely since he's been pretty silent for over a year. :-(
                  RHCE, author of zbxapi
                  Ansible, the missing piece (Zabconf 2017): https://www.youtube.com/watch?v=R5T9NidjjDE
                  Zabbix and SNMP on Linux (Zabconf 2015): https://www.youtube.com/watch?v=98PEHpLFVHM

                  Comment

                  • orogor
                    Junior Member
                    • Oct 2009
                    • 4

                    #10
                    Too bad

                    Really that was a very good idea, basically when you see an hourly average value at 50% above or under the hourly average of the same period either last day/week/month you can trigger at least a warning.

                    And that can act as a very good default trigger for maybe 80% of any item.

                    Comment

                    • zabbix_zen
                      Senior Member
                      • Jul 2009
                      • 426

                      #11
                      Any chance this will be included as a Macro in Z1.8 or at least Z1.8.1?

                      Comment

                      • Alexei
                        Founder, CEO
                        Zabbix Certified Trainer
                        Zabbix Certified SpecialistZabbix Certified Professional
                        • Sep 2004
                        • 5654

                        #12
                        It is very likely it will be included! Please register a feature request!
                        Alexei Vladishev
                        Creator of Zabbix, Product manager
                        New York | Tokyo | Riga
                        My Twitter

                        Comment

                        • zabbix_zen
                          Senior Member
                          • Jul 2009
                          • 426

                          #13
                          Thanks.

                          Filed as ZBXNEXT-119

                          Comment

                          • zabbix_zen
                            Senior Member
                            • Jul 2009
                            • 426

                            #14
                            You're using the right command,
                            thing is the patch was made for an obsolete version.
                            You can either modify it accordingly to the version you want to patch it against or wait for the developers to include it in Zabbix 1.8

                            In the meanwhile you can vote for and watch it in,

                            Comment

                            • Alexei
                              Founder, CEO
                              Zabbix Certified Trainer
                              Zabbix Certified SpecialistZabbix Certified Professional
                              • Sep 2004
                              • 5654

                              #15
                              It has been implemented in a different (better?) way, see https://support.zabbix.com/browse/ZBXNEXT-119.

                              The functionality will be available in 1.8.2.
                              Alexei Vladishev
                              Creator of Zabbix, Product manager
                              New York | Tokyo | Riga
                              My Twitter

                              Comment

                              Working...