Ad Widget

Collapse

Log file monitoring: retail latest values or reread file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Bertus_Brutalis
    Junior Member
    • Jul 2018
    • 9

    #1

    Log file monitoring: retail latest values or reread file

    Hello all,

    I'm using a standard log file monitoring item to extract a value from a log file (using regexp). The issue now is, that upon the next update interval the file will be read from the point it stopped before, and no new value will be extracted (the needed value is only sparsely listed). The item then shows an empty value on the latest data overview, and I must check the items history to view the actual last value.
    So, I'm either looking for a way to retain the last actual value in case an empty value is extracted (just ignore the empty value), or for a way to force the check to reread the entire file again. Any ideas?
    Last edited by Bertus_Brutalis; 30-10-2024, 11:58. Reason: typo
  • cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4806

    #2
    How is it returning empty rows? log items return the count or matched rows, but they do not return empty answers...
    Latest data shows you usually values that are not more than 24h old. you can change that in settings (Administration -> General -> GUI -> Click image for larger version

Name:	image.png
Views:	97
Size:	3.6 KB
ID:	493561
    I am not sure if that affect some data overview widget also or not...

    Comment

    • Bertus_Brutalis
      Junior Member
      • Jul 2018
      • 9

      #3
      Hello Cyber,

      I assumed that the first time the item runs, it reads the logfile and returns my wanted value. The second time the item runs it continues reading the logfile from the point it stopped the first time, and if no lines have been added to the log or my regexp does not yield a value, an the item goes to a blank value. But I think you are right though, because when I look in the item history, there is only one value given and no extra "empty" entries. So I guess it has to do with the setting you shared. I'll check further on that. Thanks!

      Comment

      Working...