[collectd] [PATCH] generic log monitoring
octo<span style="display: none;">.trailing-username</span>(a)<span style="display: none;">leading-domain.</span>verplant.org
Tue Mar 20 09:31:39 CET 2007
On Mon, Mar 19, 2007 at 07:37:12PM +0100, Francisco Jesus Monserrat Coll wrote:
> After seeing the SA plugin some time ago , I decided to try a more
> generic plugin, to allow collectd to have new rrd file created bases
> in regular expression search in log files.
thanks for your plugin :)
> As Sebastian Plugins this plugin will listen in a Unix socket and
> process lines with the following format:
The next major version, collectd 4, will feature a `unixsock plugin'
that, so far, is used to query values from collectd but is supposed to
be expanded to allow more command, including submitting values to
collectd. That'd be on possible way to do this in the future.
The other possibility is the `exec plugin', also featured in the next
major version. Since it assures that only one instance is running at a
time, you could implement log-searching like this:
-- 8< --
tail -f $LOGFILE | egrep $REGEXP | $SCRIPT_DIR/extract_fields.pl
-- >8 --
I'm sure Sebastians `perl plugin' (once it's done) will allow for even
more ways to do this ;)
Since the next version's `unixsock plugin' will allow more ``commands''
it requires a different syntax. IMHO it'd be a good idea to change the
syntax of your plugin to make switching easier. I propose the following
"PUTVAL " <hostname> "/" <plugin> ["-" <plugin-instance>] "/" <type> ["-" <type-instance>] " " <ds-name> "=" <value> [" " <ds-name> "=" <value> [...]]
PUTVAL localhost/cpu-0/cpu-user value=372019
PUTVAL otherhost/interface/if_octets-eth0 rx=91051149 tx=14415390
You could require `hostname', `plugin', `plugin-instance', and `ds-name'
to be some fixed strings for now, only allow one DS per line and only
use `type' and, if provided, `type-instance' to store values. That way
you plugin would use a strict subset of the `unixsock plugin' and
upgrading to the next version will be a lot easier.
What do you think? Any opinions, anyone else?
Florian octo Forster
Hacker in training
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: Digital signature
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20070320/93f66fcb/attachment.pgp
More information about the collectd