Ad Widget

Collapse

Custom periods at last#

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Tristis Oris
    Member
    • Sep 2015
    • 66

    #1

    Custom periods at last#

    Is it possible to use something like macro at trigger
    Code:
    last(/itemname,#5)
    instead of #5?
    i need custom periods for each host to change it via API.
  • Hamardaban
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • May 2019
    • 2713

    #2
    And why not just read the documentation? Everything is clearly written there.
    https://www.zabbix.com/documentation...fig/items/item
    Update interval Retrieve a new value for this item every N seconds. Maximum allowed update interval is 86400 seconds (1 day).
    Time suffixes are supported, e.g., 30s, 1m, 2h, 1d.
    User macros are supported.
    A single macro has to fill the whole field. Multiple macros in a field or macros mixed with text are not supported.
    Note: The update interval can only be set to '0' if custom intervals exist with a non-zero value. If set to '0', and a custom interval (flexible or scheduled) exists with a non-zero value, the item will be polled during the custom interval duration.
    Note that the first item poll after the item became active or after update interval change might occur earlier than the configured value.
    New items will be checked within 60 seconds of their creation, unless they have Scheduling or Flexible update interval and the Update interval is set to 0.
    An existing passive item can be polled for value immediately by pushing the Execute now button.
    Custom intervals You can create custom rules for checking the item:
    Flexible - create an exception to the Update interval (interval with different frequency)
    Scheduling - create a custom polling schedule.
    For detailed information see Custom intervals.
    Time suffixes are supported in the Interval field, e.g., 30s, 1m, 2h, 1d.
    User macros are supported.
    A single macro has to fill the whole field. Multiple macros in a field or macros mixed with text are not supported.
    Scheduling is supported since Zabbix 3.0.0.
    Note: custom intervals for active checks are supported by Zabbix agent 2 only.

    Comment

    • Tristis Oris
      Member
      • Sep 2015
      • 66

      #3
      Because i already tried macro and trigger didn't work.

      Code:
      [I]Note[/I]: custom intervals for active checks are supported by Zabbix agent 2 only.​
      I have agentless checks, http get method for text value and some preprocessing.

      full trigger look like
      Code:
      (last(/item,#1)-last(/item,#5))<=-{$TEMP_FAST}
      this one invalid syntax
      Code:
      (last(/item,#1)-last(/item,#{$INTERVAL_MACRO}))<={$TEMP_FAST}
      this one do nothing
      Code:
      (last(/item,#1)-last(/item,{$INTERVAL_MACRO}))<={$TEMP_FAST}

      Comment

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

        #4
        should work
        Code:
        (last(/host/key)-last(/host/key,{$INTERVAL_MACRO}))<={$TEMP_FAST}
        {$INTERVAL_MACRO} ==> #5

        Comment

        • Tristis Oris
          Member
          • Sep 2015
          • 66

          #5
          Yes, macro value is #5, not just 5.

          Not sure why, same expression begin to work now. But i'm not 100% sure is it compare #n value, not just 5. Thanks anyway.

          Comment

          Working...