Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks,
I need to monitor the log files of processes. And it should alert me whenever the log file gets updated beyond the specified limit within the certain amount of time. Let say, in the normal case, the file used to be updated to a max size of 1MB with 10 minutes. In some cases if the files grows beyond this limit, then it should be alerted in such a way.
Thanks in Advance,
Balakrishnan M

Replies are listed 'Best First'.
Re: module for monitoring log file
by moritz (Cardinal) on Jul 23, 2009 at 09:26 UTC
    You can use File::Monitor or similar modules (like Linux::Inotify2) to get a notification when the file changes, and then check the size yourself (see -s).

    Or, even simpler, periodically poll the file size and sleep between polls.

Re: module for monitoring log file
by imrags (Monk) on Jul 23, 2009 at 09:25 UTC
    Use File::Stat module of Perl...
    Raghu