Previously, a pointer into the configuration structure was used to look up the mappings. Because the configuration structure is freed or otherwise modified, this does not work as intended (and may actually lead to a segmentation fault when unlucky). For completeness sake, a shutdown callback was added to free the used memory on exit. Fixes Github issue 224.
…mber of tags.
The reference to the riemann_host structure is shared between the write and the notification callback. Upon exit, riemann_free() is called twice, via the user_data_t structure passed to the register functions. Previously this would have caused a double-free, which is unacceptable. This patch introduces a reference counter and will only free the structure (and close the socket) when the last reference is freed. The locking has been moved out of the riemann_connect() function and into the riemann_send() function. It is unlikely, but not impossible that two threads interfere with each other when writing to the socket.
This also adds a couple more tags, e.g. "type:..." and so on. The "host" field is now correctly populated from the vl->host or n->host field.
Make the passed in "Msg*" const, use swrite() to make sure the entire buffer is sent and break out the disconnect logic into an own function.
Thanks to Yves Mettier for pointing this out!
…e> block. This has the advantage of being more easy to read/understand and also being more flexible. E.g. multiple filters and other options may be specified in the future. Thanks to octo for suggesting this!
…ULL. Fixes Github issue 202.
An optional second argument may now be passed to the "Include" configuration option. If specified (and if the fnmatch() function was available at build time), only files matching this pattern will be included. For example, the following will include all files matching "*.conf" in any subdirectory of /etc/collectd.d/: Include "/etc/collectd.d" "*.conf" This is useful, e.g. for distributions in order to include a possibly empty directory in the default configuration including all subdirectories but also making it possible to ship further documents like README files.
… mentioning the per-plugin interval setting.
The name generated by the Aggregation plugin currently includes the regular expression, which is suboptimal. We need to come up with something clever there I guess.