Ad Widget

Collapse

analyze log fle from start

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Fred V
    Junior Member
    • Feb 2024
    • 1

    #1

    analyze log fle from start

    Hi,

    I'm a new Zabbix user, is it possible to always read the log file from start. I have a log file which keeps track of the connection status from several devices. If the connection status of a device changes the line which contains the device is updated.

    Example

    Device - IP address - Status - Firmware
    Device1 - 10.1.1.1 - Connected - 1.03
    Device2 - 10.1.1.2 - Connected - 1.03

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

    #2
    log and logrt items are intended to read from the end and only the added part. But you can use vfs.file.contents to pull whole file and then you can do whatever with that...
    vfs.file.contents[file,<encoding>]
    Retrieving contents of a file. Text file - full path to file
    encoding - code page identifier
    Returns an empty string if the file is empty or contains LF/CR characters only.

    The return value is limited to 16MB (including trailing whitespace that is truncated); database limits also apply.

    Byte order mark (BOM) is excluded from the output.

    Example:
    => vfs.file.contents[/etc/passwd]

    Comment

    Working...