Ad Widget

Collapse

Monitoring of various logs with wildcards in the directory?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Frazzxr
    Junior Member
    • Aug 2017
    • 1

    #1

    Monitoring of various logs with wildcards in the directory?

    Hello all,

    We currently use another monitoring solution and are looking to change. In our other solution, I am allowed to use wildcards in the directory. I.e. logs with different names in different directories can use the same list of errors to make setup easier.

    Using c:\inet\*\logs\*.log

    Will pickup and process logs in:
    C:\inet\dir1\logs\anyfile.log
    C:\inet\dir2\logs\anyfile.log
    C:\inet\dir3\logs\anyfile.log

    Is there any way to do something similar with zabbix? All our logs have different names and different directories.

    Thanks,
    Tony
  • andris
    Zabbix developer
    • Feb 2012
    • 228

    #2
    Currently Zabbix does not support monitoring multiple log files within one item.
    For each log file you create a log[] item (if log name never changes) or a logrt[] item (if log file is rotated). Then Zabbix agent tracks the log file's size, modification time, inode etc. to detect log file append/truncation/rotation.
    So, directory name cannot be a regexp. Only file name can be a regexp to match the current and older, rotated-away log files.

    Comment

    • careem111
      Junior Member
      • Jan 2021
      • 1

      #3
      I need to monitor bunch of log files in a single directory ,
      in a single day multiple log files created and the number of log files will vary each day and the filename is not the same and i need to monitor all the log files belongs for current day.
      Is it possible in Zabbix?

      Comment

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

        #4
        Short answer no. It requires one item per logfile. If you don't know the names and amount of files, there is no easy way to make those items. Zabbix does not do "discovery" in the directory and create item per logfile...

        If you know names and all that is changing, is a date in name (for example tech_error_<date>, system_log_<date> etc), then you can add logfile names with regex representing date and it will read the latest one modified that matches the regex.

        Comment

        Working...