[collectd] tail plugin

Luke Heberling collectd at c-ware.com
Mon Feb 25 20:51:17 CET 2008


Luke Heberling wrote:
>> Shouldn't we read the old filehandle to the end first?
> Yes. I'll fix that, test it in isolation, and send a patch.

Here it is.

Also fixed another problem which surfaced when attempting
to tail a file which did not initially exist.  In attempting to seek
to the end of the file that is there initially to avoid reading in
the entire existing file (think 'tail -F -n infinity') , my previous
code used the presence of a previous inode number to
determine whether it was the first run.  If it was not the first
run, but there was no file found on the first run, then the inode
was not set which caused a seek to the end of the file, skipping
all lines between the first read which returned data and the read
immediately prior to it.

utils_tail_incremental.diff can be applied after utils_tail.diff
sent previously.

OR

utils_tail.diff can be applied instead of utils_tail.diff sent
previously.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: utils_tail.diff
Type: text/x-diff
Size: 6030 bytes
Desc: not available
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20080225/66c4c5f6/attachment.diff 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: utils_tail_incremental.diff
Type: text/x-diff
Size: 2500 bytes
Desc: not available
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20080225/66c4c5f6/attachment-0001.diff 


More information about the collectd mailing list