Ad Widget

Collapse

trigger for latest data in log

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ezols
    Member
    • Dec 2021
    • 33

    #1

    trigger for latest data in log

    Hey,

    Im having problems creating simple trigger on zabbix 6.2, when any new data shows up it log file I want to execute trigger.
    In zabbix 5.x i did it:
    1. item - logrt[/path/to/log/error_files_*]
    2. trigger - {host:logrt[/path/to/log/error_files_*].last(#1)}<>0

    This works without problems, whenever something new shows up in error_files_* trigger gets executed.

    In zabbix 6.2 i did it:
    1. item - logrt[/path/to/log/error_files_*]
    2. trigger - last(/host/logrt[/path/to/log/error_files_*],#1)
    Created trigger based on this https://www.zabbix.com/documentation...ctions/history
    Example:
    => last(/host/key) → retrieve the last value
    But this doesn't work, items is updated with latest entries, but trigger not firing.
    Can you please advise a proper trigger in zabbix 6.2 which would execute if any new data shows up in error_files_* logs?

    Thanks in advance.
    Last edited by ezols; 23-08-2022, 13:30.
  • cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4807

    #2
    in 5.x you had comparison there "<>0" ... Why did you omit it in v6.2?

    Comment

    • ezols
      Member
      • Dec 2021
      • 33

      #3
      i tried with <>0 and without, had no luck, but fix was simple, changed back to <>0 disabled, enabled trigger all working. if i just edited same trigger without disabling/enabling then it didn't work even with <>0
      Case closed.

      Thanks.

      Comment

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

        #4
        Triggers will be recalculated, when new values arrive, so if you just modify trigger and no new values arrive, it does not fire. I guess recalculation also takes place, when enabling a trigger (eventho no mention in docs https://www.zabbix.com/documentation...onfig/triggers ), that's why you got your result with disabling/enabling.

        Comment

        • dimir
          Zabbix developer
          • Apr 2011
          • 1080

          #5
          A trigger expression is not evaluated when it gets enabled. Only on receiving a value (or, if time-based functions are used in the expression, every 30 seconds). Will try to push adding this note to that page:

          Last edited by dimir; 25-08-2022, 13:32.

          Comment

          Working...