monitoring-plugins icon indicating copy to clipboard operation
monitoring-plugins copied to clipboard

logfile: Check does not handle wildcards in filename

Open drapiti opened this issue 1 year ago • 5 comments

Describe the solution you'd like

The check must be able to handle the most common logfile monitoring scenario where the logfile name has a date in its name which is automatically rotated.
At the momento using a fixed filename the check is not usable.

Additional context

No response

drapiti avatar May 23 '23 15:05 drapiti

Counter question: Why monitoring older (rotated) logfiles? For example /var/log/messages vs. /var/log/messages-20230501

markuslf avatar May 23 '23 15:05 markuslf

No it is not for monitoring older files but for files with the current date in the name. So every day the filename changes. My specific use case at the moment is on windows. Example: YYYYMMDD.log

drapiti avatar May 23 '23 15:05 drapiti

Ok, got it, thank you.

markuslf avatar May 23 '23 15:05 markuslf

I have seen the same requirement but was lucky and could convince the developer to stop this and rotate the logs. A quick try to use the DSL to construct the current date for the file name failed - maybe possible but I ran out of time.

slalomsk8er avatar May 24 '23 07:05 slalomsk8er

No it is not for monitoring older files but for files with the current date in the name. So every day the filename changes. My specific use case at the moment is on windows. Example: YYYYMMDD.log

I have the same problem with the daily rotation of laravel. (laravel-YYYY-MM-DD.log) Thanks in advance

CristianGLepore avatar Sep 15 '23 12:09 CristianGLepore