[collectd] How to store MySQL statistics?

Niki Waibel niki.waibel at newlogic.com
Tue Dec 20 14:29:56 CET 2005


>> hmmm -- i dont know that much about the mysql quotas,
>                                           ^^^^^^^^^^^^
> Hehe, you've spent too much time with quotas ;)

jesus ... yes, it seems so.

>> but i really think that a dir structure is necessary for the .rrd
>> files. at least for the quota plugin, i think there is no
>> workaround...
> 
> Good idea, I haven't thought of that..
> 
>> one of:
>>         plugin_submit()
>>         plugin_write()
>>         <plugin>_write)()
>>         rrd_update_file()
>> should be able to create the dirs if necessary.
> 
> It should be easy to change `rrd_update_file' so it creates
> subdirectories if the filename passed to it includes a slash..

yes, seems to be the easiest way to do it there...
this directory thing is pretty hairy from a security point of
view!!!
../../.. and symbolic links schould be checked.
a nice possability for a buffer overflow.
we have to keep in mind that collectd runs as root all the time.
maybe it would make sense to switch user and group for
writing a files ... i think there was a way to switch and
then continue work as root.

maybe the default should be that all privilegues are dropped,
and only for special modules that need it those are kept.
most things the modules do can be done as user!

> `plugin_submit' may not be on the same machine,

yes, right.

> `plugin_write' doesn't
> know the filename yet[1] and putting that int `<plugin>_write()' would
> be super-redundant..

hehe, yes. just mentioned it to see what's called in which order.

> [1] If all RRD-files are created under a subdirectory with the name of
> the plugin then `plugin_write' could create the directory. However,
> since such a change would require much user-action I don't want to do
> that..

yes, right. rrd_update_file() is def the function it has to go into.

niki



More information about the Collectd mailing list