[rrd-users] Re: handling rotated logs
Boris Bukowski
b.bukowski at gmx.de
Sun Nov 24 23:58:14 MET 2002
Am Thursday 21 November 2002 07:54 schrieb Jim Breton:
> I have a problem where I am counting statistics on mail delivery: messages
> delivered, messages rejected, and messages "tagged" by Spam Assassin.
>
> I gather the stats using simple greps on the current mail log file.
> However, the logs are rotated nightly and RRDTool assumes an overflow.
Hi,
use logtail to do tasks like this.
It is a part of the logcheck package
http://www.psionic.com/tools/logcheck-1.1.tar.gz
DESCRIPTION from the manpage:
logtail reads a specified file (usually a log file) and writes to the
standard output part of it which have not been read by previous runs of
logtail. It prints the last some bytes of logfile appropriately, assuming
that all changes that are made to it are to add new characters to it.
logfile must be a plain file. A symlink is not allowed.
logtail stores the information about how much it have already read in a
separate file called offsetfile. offsetfile can be omitted. If omitted,
the file named logfile.offset in the same directory which contains logfile is
used by default.
If offsetfile is not empty, the inode of logfile is checked. If the
inode is changed, logtail simply prints the entire file. If the inode is not
changed but logfile is shorter than it was at the last run of logtail,
it writes a warning message to the standard output.
Boris
--
Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive http://www.ee.ethz.ch/~slist/rrd-users
WebAdmin http://www.ee.ethz.ch/~slist/lsg2.cgi
More information about the rrd-users
mailing list