Ad Widget

Collapse

Trigger if log is not written

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vittoriopalomba
    Junior Member
    • Sep 2019
    • 2

    #1

    Trigger if log is not written

    Hi all,
    I have a problem with the creation of a trigger that checks if a word was written within a certain time in a log.
    I have this item and this trigger:

    - logrt[/var/log/test.log,Evento terminato \:,,,skip,,,]
    - {Template Test Log:logrt[/var/log/test.log,Evento terminato \:,,,skip,,,].nodata(1h)}=1 and {Template Test Log:logrt[/var/log/test.log,Evento terminato \:,,,skip,,,].time()}=004515

    I would like Zabbix to verify the absence in the last hour of the string "Evento terminato :" in the log at 00:45, triggering the alarm.
    I check the item in "Latest data" and it works correctly.

    What am I doing wrong ?

    Thanks a lot,
    Vittorio
  • Hamardaban
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • May 2019
    • 2713

    #2
    If the task is just to track the number of records in the log with the desired substring easier to use logrt.count . Call once per hour and use last()=0 in the trigger. ( I can assume that nodata() does not work correctly in the case of logrt)

    Comment

    • vittoriopalomba
      Junior Member
      • Sep 2019
      • 2

      #3
      Hi Hamardaban, thanks for your reply. My task is only to trigger an alarm if the string "Evento terminato :" is not in log in the hour before 00:45.

      Comment

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

        #4
        I understood. And suggested to try the option with other data element.

        Comment

        Working...