Ad Widget

Collapse

logrt or log?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tcweb
    Member
    • Jun 2024
    • 40

    #1

    logrt or log?

    We have an application that writes to a log file "log.0". When log.0 reaches a configured number of lines, it is renamed to "log.1", and a new "log.0" is created. If there was already a log.1, it woudl be renamed to log.2, etc, etc.
    This way, the app can keep N number of log files. (we usuallly keep 10 or 20). Note: I did not come up with this, it's a legacy application.

    This being said, I would THINK that I could use the log[] function, since the log I wish to monitor is always "log.0". But I've been seeing posts elsewhere that say the logrt[] should be used because log[] could get confused when the log copy/switch happens.
    The Zabbix documentation doesn't cover this sort of example.

    As a follow-on question, is it advisable to set a polling interval of 3s for a log or logrt function? Our log is very busy, we may write hundreds of lines per second.

    Another follow-on question: I know that I can have multiple log or logrt items on the same file. But are there any concerns with doing this? Performance?

    Thanks in advance for any guidance.

    -Tom
  • tcweb
    Member
    • Jun 2024
    • 40

    #2
    Also, I'm seeing these documented options:
    • maxdelay - the maximum delay in seconds. Type: float. Values: 0 - (default) never ignore log file lines; > 0.0 - ignore older lines in order to get the most recent lines analyzed within "maxdelay" seconds. Read the maxdelay notes before using it!
    • options - the type of log file rotation and other options. Possible values:
      rotate (default),
      copytruncate - note that copytruncate cannot be used together with maxdelay. In this case maxdelay must be 0 or not specified; see copytruncate notes,
      mtime-reread - non-unique records, reread if modification time or size changes (default),
      mtime-noreread - non-unique records, reread only if the size changes (ignore modification time change).

    But I'm not sure if these are valid. I'm using agent2, and wondering if some of these documented options just don't exists yet....

    Comment

    Working...