Uploaded image for project: 'ZABBIX FEATURE REQUESTS'
  1. ZABBIX FEATURE REQUESTS
  2. ZBXNEXT-6601

Zabbix Trigger Function for Monotonic Items

XMLWordPrintable

    • Sprint 78 (Jul 2021), Sprint 79 (Aug 2021)
    • 1

      I have several trigger expressions that look for monotonically increasing items. For example, I monitor applications that perform messaging and when something goes wrong the message queue increases. I also monitor applications that are supposed to read files from disk and if the application fails we can tell by counting the files in the directory and checking if they are increasing monotonically. I have several expressions like,

      "{Host1:system.app.messaging.last()} > *

      {Host1:system.app.messaging.prev()}

      and* *

      {Host1:system.app.messaging.prev()}

      > 

      {Host1:system.app.messaging.last(#3)}

      and* *

      {Host1:system.app.messaging.last(#3)}

      > 

      {Host1:system.app.messaging.last(#4)}

      "*********

      ...and so on up to last(#24) or even higher in some cases. This makes the trigger expression quite large and difficult to read. Is it possible to add a new trigger function that does something like the below (written in javascript as an example):

      // assume var array is an time-ordered (ascending) list of values retrieved from zabbix

      var array = [1, 3, 5, 6, 7];
      var is_monotonic_increasing = true;
      var is_monotonic_decreasing = true;
      for (let i = 1; i < array.length; i++) {
          if (array[i] < array[i - 1]) {
              is_monotonic_increasing = false;
          }
          if (array[i] > array[i - 1]) {
              is_monotonic_decreasing = false;
          }
      }
      console.log(is_monotonic_increasing);
      console.log(is_monotonic_decreasing);

       

      The function name could be something like:

      monotonic(sec|#num,<operator>,time_shift)

      where <operator> would either be "increasing" or "decreasing".

      Real example allowing us to check if all values received in the last 6 hours are monotonically increasing:

      *

      {Host1:system.app.messaging.monotonic(6h,"increasing")}

      = 1*

      Real example checking if all values in the last 10 values are monotonically decreasing:

      *

      {Host1:system.app.messaging.monotonic(#10,"decreasing")}

      = 1*

       

      Thank you so much for your time and I hope this possible!

        1. XXX2.jpg
          23 kB
          Artjoms Rimdjonoks
        2. XXX_1.jpg
          18 kB
          Artjoms Rimdjonoks

            arimdjonoks Artjoms Rimdjonoks
            GRyan337 Ryan Eberly
            Team C
            Votes:
            3 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              Resolved: