[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: filesize check for symlink target
From: |
Martin Pala |
Subject: |
Re: filesize check for symlink target |
Date: |
Tue, 27 Mar 2012 14:15:56 +0200 |
Hi Wayne,
the file check supports the symlinks - the size test verifies the symlink's
target size, not the symlink itself. For example:
mkfile 10m /tmp/myfile
ln -s /tmp/myfile /tmp/mylink
The following monit configuration which check the file via symlink will report
problem, as the my file size exceeded 5m:
--8<--
check file myfile_symlink with path /tmp/mylink
if size > 5 MB then alert
--8<--
Test output:
--8<--
'myfile_symlink' size test failed for /tmp/mylink -- current size is 10485760 B
--8<--
Regards,
Martin
On Mar 23, 2012, at 1:26 PM, Lawrence, Wayne wrote:
> Hi,
>
> I was wondering if there is any way for monit to check the file size of a
> symlink target.
>
> I use linked logs and chronolog and want to keep an eye on the current log
> file size but cant seem to find a way of doing this in monit.
>
> for example my apache.log links to 2012/Mar/apache.log obviously this rotates
> monthly and i want to monitor the target file without having to change the
> config every month.
>
> If anyone can shed some light on this it would be great.
>
> Regards
>
> Wayne
> --
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general