Code

collectd.git
11 years agowrite_riemann plugin: Reorder the functions to get rid or prototypes.
Florian Forster [Sun, 7 Apr 2013 15:45:47 +0000 (17:45 +0200)]
write_riemann plugin: Reorder the functions to get rid or prototypes.

11 years agowrite_riemann plugin: Use the "Attributes" of an Event rather than abuse the "Tags".
Florian Forster [Sun, 7 Apr 2013 05:10:20 +0000 (07:10 +0200)]
write_riemann plugin: Use the "Attributes" of an Event rather than abuse the "Tags".

Riemann 0.2.0 provides "Attributes", which are key-value pairs. Since
the plugin previously basically abused the tag system for adding this
kind of data, switch to the new and shiny thing :)

11 years agosrc/riemann.proto: Import the protocol buffer for Riemann 0.2.0.
Florian Forster [Sun, 7 Apr 2013 05:08:47 +0000 (07:08 +0200)]
src/riemann.proto: Import the protocol buffer for Riemann 0.2.0.

11 years agoMerge branch 'collectd-5.2'
Florian Forster [Sun, 7 Apr 2013 04:17:49 +0000 (06:17 +0200)]
Merge branch 'collectd-5.2'

11 years agoMerge branch 'collectd-5.1' into collectd-5.2
Florian Forster [Sun, 7 Apr 2013 03:54:24 +0000 (05:54 +0200)]
Merge branch 'collectd-5.1' into collectd-5.2

Conflicts:
configure.in

11 years agoMerge branch 'collectd-4.10' into collectd-5.1
Florian Forster [Sun, 7 Apr 2013 03:44:38 +0000 (05:44 +0200)]
Merge branch 'collectd-4.10' into collectd-5.1

Conflicts:
configure.in
src/mysql.c
src/network.c
src/thermal.c

11 years ago.gitignore: Add src/*.pb-c.[ch]
Florian Forster [Sat, 6 Apr 2013 19:29:07 +0000 (12:29 -0700)]
.gitignore: Add src/*.pb-c.[ch]

11 years agoconfigure.in: Fix dependency of the pinba and write_riemann plugins.
Florian Forster [Sat, 6 Apr 2013 19:26:50 +0000 (12:26 -0700)]
configure.in: Fix dependency of the pinba and write_riemann plugins.

Since the generated *.pb-c.[ch] files are now included in the
distribution, they only depend on the <google/protobuf-c/protobuf-c.h>
header file, not the protobuf compiler.

11 years agosrc/Makefile.am: Move *.pb-c.[ch] to MAINTAINERCLEANFILES.
Florian Forster [Sat, 6 Apr 2013 19:25:26 +0000 (12:25 -0700)]
src/Makefile.am: Move *.pb-c.[ch] to MAINTAINERCLEANFILES.

Only generate build rules for these files if protoc-c is available and
use the provided files from the distribution if it is not.

11 years agosrc/Makefile.am: Include .c and .h files generated from Protocol Buffers in the distr...
Yves Mettier [Sat, 6 Apr 2013 18:14:27 +0000 (11:14 -0700)]
src/Makefile.am: Include .c and .h files generated from Protocol Buffers in the distribution.

Fixes Github issue #269.

Signed-off-by: Florian Forster <octo@collectd.org>
11 years agobindings/Makefile: Hint the user at --with-perl-bindings.
Sebastian Harl [Tue, 20 Nov 2012 13:56:45 +0000 (14:56 +0100)]
bindings/Makefile: Hint the user at --with-perl-bindings.

… in case 'perl Makefile.PL' fails.

Fixes Github issue #290.

Signed-off-by: Florian Forster <octo@collectd.org>
11 years agobuild system (Perl bindings): Make Makefile.PL's PREFIX/INSTALL_BASE optional.
Sebastian Harl [Tue, 20 Nov 2012 13:44:43 +0000 (14:44 +0100)]
build system (Perl bindings): Make Makefile.PL's PREFIX/INSTALL_BASE optional.

Both options may cause problems:

 - PREFIX might clash with INSTALL_BASE being set in $PERL_MM_OPT.
 - INSTALL_BASE without any further options set will install into non-standard
   directories in many cases.

Rather, use PREFIX=${prefix} as default but overwrite that if
--with-perl-bindings=... has been used.

Thanks to faxm0dem for reporting the INSTALL_BASE problems on IRC and
bvarner and nirik for reporting this in GH #177 and #196.

This is a follow-up / fix for 97e8f346a88eccf4d1608c21d5cc6ee9620c1c41.

Fixes Github issue #290.

Signed-off-by: Florian Forster <octo@collectd.org>
11 years agonetwork plugin: Make sure gcrypt is initialized before using any of its functions.
Florian Forster [Sat, 6 Apr 2013 16:23:16 +0000 (18:23 +0200)]
network plugin: Make sure gcrypt is initialized before using any of its functions.

@marekbecka found that sockent_open() is called during the configuration
phase, but gcrypt is initialized later, during the initialization phase.
This patch will initialize gcrypt in sockent_open() if any sockets with
security are configured.

Fixes Github issue #273.

11 years agoDon't clobber TMPDIR during Java detection
Dave Cottlehuber [Thu, 7 Feb 2013 00:38:07 +0000 (01:38 +0100)]
Don't clobber TMPDIR during Java detection

- Java detection used TMPDIR as var to parse command output
- TMPDIR is used in libltdl later on in ./configure
- alternative fix is local var or subshell
- fixes issue introduced via #33163ee

Conflicts:
configure.in

Signed-off-by: Florian Forster <octo@collectd.org>
11 years agonotify_email: Add charset in Content-Type header (seems required by some picky spam...
Manuel CISSÉ [Fri, 15 Feb 2013 10:03:00 +0000 (11:03 +0100)]
notify_email: Add charset in Content-Type header (seems required by some picky spam filters)

Signed-off-by: Florian Forster <octo@collectd.org>
11 years agoconfigure.in: Check for protobuf-c.h.
Florian Forster [Fri, 5 Apr 2013 05:31:35 +0000 (07:31 +0200)]
configure.in: Check for protobuf-c.h.

Thanks to Yves Mettier pointing this out in #269 and for providing an
initial patch.

11 years agonfs plugin: Copy the name before calling the non-const lookup function.
Florian Forster [Mon, 1 Apr 2013 14:54:45 +0000 (16:54 +0200)]
nfs plugin: Copy the name before calling the non-const lookup function.

Fixes Github issue #70. Thanks to Jeff for reporting this issue.

11 years agorrdcached plugin: Connect to the daemon in the read() callback.
Florian Forster [Mon, 1 Apr 2013 14:38:08 +0000 (16:38 +0200)]
rrdcached plugin: Connect to the daemon in the read() callback.

Fixes Github issue #275. Thanks to Yves Mettier for reporting this bug!

11 years agoMerge branch 'collectd-5.1' into collectd-5.2
Florian Forster [Fri, 29 Mar 2013 20:30:21 +0000 (13:30 -0700)]
Merge branch 'collectd-5.1' into collectd-5.2

11 years agosrc/libcollectdclient/network_buffer.c check for htonll exitence
gkos [Wed, 13 Mar 2013 16:19:04 +0000 (13:19 -0300)]
src/libcollectdclient/network_buffer.c check for htonll exitence
before defining it. I have to to this to get it compiled on AIX6

Signed-off-by: Florian Forster <octo@collectd.org>
11 years agoconfigure.in: Yet another attempt at fixing the mess that is AC_LANG_PROGRAM().
Florian Forster [Fri, 29 Mar 2013 13:43:39 +0000 (06:43 -0700)]
configure.in: Yet another attempt at fixing the mess that is AC_LANG_PROGRAM().

11 years agothermal plugin: set the hostname
Markus Knetschke [Sun, 23 Dec 2012 10:50:22 +0000 (11:50 +0100)]
thermal plugin: set the hostname

Signed-off-by: Markus Knetschke <markus.knetschke@gmail.com>
Signed-off-by: Florian Forster <octo@collectd.org>
11 years agothermal plugin: fixed value submitting
Markus Knetschke [Sun, 23 Dec 2012 10:02:42 +0000 (11:02 +0100)]
thermal plugin: fixed value submitting

Signed-off-by: Markus Knetschke <markus.knetschke@gmail.com>
Signed-off-by: Florian Forster <octo@collectd.org>
11 years agoAllow parsing plugin_instance in parse_option().
Tommie Gannert [Thu, 7 Mar 2013 08:10:03 +0000 (09:10 +0100)]
Allow parsing plugin_instance in parse_option().

isalnum() is not enough to catch the underscore.

Signed-off-by: Florian Forster <octo@collectd.org>
11 years agomysql plugin: Call mysql_init() only once.
Florian Forster [Mon, 25 Mar 2013 06:28:36 +0000 (07:28 +0100)]
mysql plugin: Call mysql_init() only once.

Apparently, if you call it with a structure allocated by mysql_init()
itself, it leaks memory. Thanks to Yves Mettier for pointing this out!

Fixes Github issue #274.

11 years agoconfigure.in: Fix quoting of AC_LANG_PROGRAM().
Florian Forster [Thu, 21 Feb 2013 10:18:53 +0000 (11:18 +0100)]
configure.in: Fix quoting of AC_LANG_PROGRAM().

Autoconf 2.68 complains about that and aborts building the configure
script. *sigh*

11 years agorrdtool plugin: Use cdrand_range() for the random variation.
Florian Forster [Sun, 24 Mar 2013 13:21:27 +0000 (14:21 +0100)]
rrdtool plugin: Use cdrand_range() for the random variation.

11 years agosrc/utils_random.[ch]: Provide thread-safe random numbers.
Florian Forster [Sun, 24 Mar 2013 13:15:16 +0000 (14:15 +0100)]
src/utils_random.[ch]: Provide thread-safe random numbers.

11 years agowrite_mongodb plugin: Add authentication options.
Florian Forster [Sat, 23 Mar 2013 17:07:03 +0000 (18:07 +0100)]
write_mongodb plugin: Add authentication options.

Fixes Github issue #282.

11 years agoIncrease MAX_NUMDISKS
Greg Mason [Thu, 14 Mar 2013 19:21:33 +0000 (15:21 -0400)]
Increase MAX_NUMDISKS

On large systems (particularly ZFS systems using large JBODs), it's
quite possible to have more than 256 disks.

Signed-off-by: Florian Forster <octo@collectd.org>
11 years agorespect riemann's terminology
Pierre-Yves Ritschard [Thu, 7 Mar 2013 08:18:04 +0000 (09:18 +0100)]
respect riemann's terminology

Signed-off-by: Florian Forster <octo@collectd.org>
11 years agoGet rid of a compiler warning with gcc 4.6.3
Dan Fandrich [Mon, 18 Mar 2013 22:17:16 +0000 (23:17 +0100)]
Get rid of a compiler warning with gcc 4.6.3

...a futile warning that nevertheless kills the build thanks
to -Werror: "variable 'status' set but not used"

Signed-off-by: Florian Forster <octo@collectd.org>
11 years agocurl_xml plugin: Fixed typo in documentation
Dan Fandrich [Thu, 21 Mar 2013 21:19:48 +0000 (22:19 +0100)]
curl_xml plugin: Fixed typo in documentation

Signed-off-by: Florian Forster <octo@collectd.org>
11 years agoMerge branch 'collectd-5.2'
Florian Forster [Sat, 23 Mar 2013 09:13:02 +0000 (10:13 +0100)]
Merge branch 'collectd-5.2'

Conflicts:
configure.in

11 years agoMerge branch 'collectd-5.1' into collectd-5.2
Florian Forster [Sat, 23 Mar 2013 09:01:19 +0000 (10:01 +0100)]
Merge branch 'collectd-5.1' into collectd-5.2

11 years agoMerge branch 'kn/snort'
Florian Forster [Sat, 23 Mar 2013 08:54:39 +0000 (09:54 +0100)]
Merge branch 'kn/snort'

11 years agosrc/plugin.c: Assert that "data_sets" is non-NULL.
Florian Forster [Sat, 23 Mar 2013 08:53:28 +0000 (09:53 +0100)]
src/plugin.c: Assert that "data_sets" is non-NULL.

Otherwise we might run into an assertion in the AVL tree. This can be
triggered e.g. when calling plugin_get_ds() from within a config
callback.

11 years agotail_csv plugin: Implement the "TimeFrom" option.
Florian Forster [Sat, 23 Mar 2013 08:27:24 +0000 (09:27 +0100)]
tail_csv plugin: Implement the "TimeFrom" option.

11 years agotail_csv plugin: Rename the "Index" option to "ValueFrom".
Florian Forster [Sat, 23 Mar 2013 07:57:43 +0000 (08:57 +0100)]
tail_csv plugin: Rename the "Index" option to "ValueFrom".

11 years agotail_csv plugin: Some bug fixes.
Florian Forster [Sat, 23 Mar 2013 07:47:02 +0000 (08:47 +0100)]
tail_csv plugin: Some bug fixes.

* Query types in the init-phase rather than the config-phase. The
  types.db is not guaranteed to be available at that time.
* Make sure the "Instance" option in the <File /> blocks is optional.

11 years agoMerge branch 'jw/libvirt'
Florian Forster [Fri, 22 Mar 2013 22:05:08 +0000 (23:05 +0100)]
Merge branch 'jw/libvirt'

11 years agotail_csv plugin: Rename "Instance" blocks to "File".
Florian Forster [Fri, 22 Mar 2013 21:57:43 +0000 (22:57 +0100)]
tail_csv plugin: Rename "Instance" blocks to "File".

This way the syntax of tail_csv's configuration is closer to that of the
csv plugin.

11 years agotail_csv plugin: Rename the "snort" plugin to "tail_csv".
Florian Forster [Fri, 22 Mar 2013 21:21:57 +0000 (22:21 +0100)]
tail_csv plugin: Rename the "snort" plugin to "tail_csv".

It's actually much more generic than just Snort, so give it an
appropriately generic name.

11 years agoconfigure.in: Quote AC_LANG_PROGRAM and remove AC_INCLUDES_DEFAULT.
Florian Forster [Fri, 22 Mar 2013 20:55:02 +0000 (21:55 +0100)]
configure.in: Quote AC_LANG_PROGRAM and remove AC_INCLUDES_DEFAULT.

The latter isn't expanded anymore when quoted. There's no easy way
around this :\

11 years agoAdded instance type "total"
Johan Wirén [Mon, 18 Mar 2013 22:55:39 +0000 (23:55 +0100)]
Added instance type "total"

11 years agoReports memory allocation in bytes, not kilobytes.
Johan Wirén [Mon, 18 Mar 2013 21:56:55 +0000 (22:56 +0100)]
Reports memory allocation in bytes, not kilobytes.

11 years agoApplied the suggested changes.
Johan Wirén [Mon, 18 Mar 2013 21:49:32 +0000 (22:49 +0100)]
Applied the suggested changes.

11 years agouuid plugin: Improve parsing of the dmidecode output.
Florian Forster [Sun, 17 Mar 2013 14:50:16 +0000 (15:50 +0100)]
uuid plugin: Improve parsing of the dmidecode output.

The entire business of dividing by sizeof(char) only made the code
unreadable, because by specification sizeof(char) evaluates to 1. The
defines were expanded and the parsing is now less sensitive to
formatting changes in the dmidecode output. Module global variables have
been moved to the top.

Fixes Github issue #267 in the process.

11 years agoMerge remote branch 'origin/master'
Florian Forster [Sat, 16 Mar 2013 15:31:50 +0000 (16:31 +0100)]
Merge remote branch 'origin/master'

11 years agocurl_xml plugin: Change the "Namespace" config option …
Florian Forster [Sat, 16 Mar 2013 14:08:39 +0000 (15:08 +0100)]
curl_xml plugin: Change the "Namespace" config option …

… to expect two strings: prefix and URL separately. This way the parsing
is done in the config parser and we don't have to interpret special
characters in a string.

11 years agosrc/filter_chain.c: Fixed typos in error messages
Dan Fandrich [Sat, 2 Mar 2013 23:24:48 +0000 (00:24 +0100)]
src/filter_chain.c: Fixed typos in error messages

Signed-off-by: Florian Forster <octo@collectd.org>
11 years agoFix automatic link flags with libgcrypt 1.5.0
Dan Fandrich [Sat, 2 Mar 2013 17:13:27 +0000 (18:13 +0100)]
Fix automatic link flags with libgcrypt 1.5.0

AM_PATH_LIBGCRYPT from libgcrypt 1.5.0 sets the variables
LIBGCRYPT_CPPFLAGS and LIBGCRYPT_LIBS with their proper
values, not GCRYPT_CPPFLAGS and GCRYPT_LIBS.

Signed-off-by: Florian Forster <octo@collectd.org>
11 years agocurl_xml plugin: Added support for XML namespaces
Dan Fandrich [Wed, 6 Feb 2013 20:47:10 +0000 (21:47 +0100)]
curl_xml plugin: Added support for XML namespaces

Signed-off-by: Florian Forster <octo@collectd.org>
11 years agocurl_xml plugin: Allow XML element nodes to be selected for text
Dan Fandrich [Wed, 6 Feb 2013 20:44:03 +0000 (21:44 +0100)]
curl_xml plugin: Allow XML element nodes to be selected for text

This is a pretty basic use case, namely to select text within an XML
element, instead of just attribute values.

Signed-off-by: Florian Forster <octo@collectd.org>
11 years agocurl* plugins: Added support for POST and arbitrary headers
Dan Fandrich [Mon, 4 Feb 2013 22:29:01 +0000 (23:29 +0100)]
curl* plugins: Added support for POST and arbitrary headers

These plugins can now be used for things like SOAP or XML-RPC calls.

Signed-off-by: Florian Forster <octo@collectd.org>
11 years agoMerge branch 'collectd-5.2'
Florian Forster [Sat, 16 Mar 2013 12:44:01 +0000 (13:44 +0100)]
Merge branch 'collectd-5.2'

Conflicts:
src/plugin.c

11 years agoMerge branch 'collectd-5.1' into collectd-5.2
Florian Forster [Sat, 16 Mar 2013 12:43:26 +0000 (13:43 +0100)]
Merge branch 'collectd-5.1' into collectd-5.2

11 years agoMerge branch 'collectd-4.10' into collectd-5.1
Florian Forster [Sat, 16 Mar 2013 12:40:14 +0000 (13:40 +0100)]
Merge branch 'collectd-4.10' into collectd-5.1

Conflicts:
src/curl_json.c

11 years agocurl_xml plugin: Check for a curl_easy_perform() error first
Dan Fandrich [Wed, 6 Feb 2013 22:35:04 +0000 (23:35 +0100)]
curl_xml plugin: Check for a curl_easy_perform() error first

The value of CURLINFO_RESPONSE_CODE isn't valid otherwise.
Also, use the symbolic name CURLE_OK in all plugins where
appropriate.

Change-Id: I17ae9c7eea393ee4641296b5484c93809a662dd9
Signed-off-by: Florian Forster <octo@collectd.org>
11 years agosnort plugin: Replace the mmap() code with the tail-code from collectd.
Florian Forster [Wed, 6 Mar 2013 07:15:35 +0000 (08:15 +0100)]
snort plugin: Replace the mmap() code with the tail-code from collectd.

This makes following along a file more I/O friendly, I hope. Also, we
don't need to do quite as much buffer processing because lines are
already split for us. Also, in the unlikely case that Snort is writing
the stats file more often than collectd reads it, this will pick up all
intermediate values.

11 years agoconfigure.in: Update for autoconf 2.68.
Florian Forster [Thu, 28 Feb 2013 11:21:18 +0000 (12:21 +0100)]
configure.in: Update for autoconf 2.68.

11 years agoMerge branch 'ff/rrd-async'
Florian Forster [Wed, 27 Feb 2013 07:37:42 +0000 (08:37 +0100)]
Merge branch 'ff/rrd-async'

11 years agocollectd.conf(5): Improve documentation of CreateFilesAsync.
Florian Forster [Wed, 27 Feb 2013 07:37:29 +0000 (08:37 +0100)]
collectd.conf(5): Improve documentation of CreateFilesAsync.

11 years agoFix memory leaks when plugin gets no results
Tomas Doran [Tue, 26 Feb 2013 12:43:21 +0000 (12:43 +0000)]
Fix memory leaks when plugin gets no results

Signed-off-by: Florian Forster <octo@collectd.org>
11 years agoAUTHORS, README: Add Kris and the snort plugin.
Florian Forster [Wed, 27 Feb 2013 07:18:21 +0000 (08:18 +0100)]
AUTHORS, README: Add Kris and the snort plugin.

11 years agocollectd.conf(5): Add information about the snort plugin.
Florian Forster [Wed, 27 Feb 2013 07:17:54 +0000 (08:17 +0100)]
collectd.conf(5): Add information about the snort plugin.

11 years agosnort plugin: Free md->instance in snort_metric_definition_destroy().
Florian Forster [Tue, 26 Feb 2013 06:42:21 +0000 (07:42 +0100)]
snort plugin: Free md->instance in snort_metric_definition_destroy().

11 years agorrdtool and rrdcached plugins: Don't update the file if ...
Florian Forster [Mon, 25 Feb 2013 20:08:15 +0000 (21:08 +0100)]
rrdtool and rrdcached plugins: Don't update the file if ...

... it is being created asynchronously.

11 years agosrc/plugin.c: Assure rf->rf_next_read is initialized.
Florian Forster [Sun, 24 Feb 2013 09:41:06 +0000 (10:41 +0100)]
src/plugin.c: Assure rf->rf_next_read is initialized.

Otherwise read callbacks will be called twice on startup, causing all
sorts of trouble.

11 years agosrc/utils_rrdcreate.c: Lock files to be created.
Florian Forster [Sun, 24 Feb 2013 09:33:51 +0000 (10:33 +0100)]
src/utils_rrdcreate.c: Lock files to be created.

This works around an issue where RRDtool crashes due to two threads
trying to create the same file at the same time. This shouldn't happen
in normal operation, but an attacker could cause this, e.g. with
specially crafted network packets.

11 years agosrc/utils_rrdcreate.c: Add folding markers.
Florian Forster [Sat, 23 Feb 2013 12:16:20 +0000 (13:16 +0100)]
src/utils_rrdcreate.c: Add folding markers.

11 years agosrc/utils_rrdcreate.c: Free allocated memory in all error handling cases.
Florian Forster [Sat, 23 Feb 2013 12:13:40 +0000 (13:13 +0100)]
src/utils_rrdcreate.c: Free allocated memory in all error handling cases.

11 years agorrdtool, rrdcached plugin: Whitespace fix.
Florian Forster [Sat, 23 Feb 2013 12:10:40 +0000 (13:10 +0100)]
rrdtool, rrdcached plugin: Whitespace fix.

11 years agosrc/utils_rrdcreate.[ch]: Implement the srrd_create_async() function.
Florian Forster [Sat, 23 Feb 2013 11:28:39 +0000 (12:28 +0100)]
src/utils_rrdcreate.[ch]: Implement the srrd_create_async() function.

This new functionality, which is also exported by the rrdtool and
rrdcached plguins, allows to create new RRD files in the background.
This avoid blocking write threads on the RRD creation, when hundreds of
files need to be created.

See also Github issues #243 and #244.

11 years agolibvirt: Added support for memory allocation
Johan Wirén [Wed, 6 Feb 2013 22:37:00 +0000 (23:37 +0100)]
libvirt: Added support for memory allocation

11 years agoexec plugin: Fix a copy'n'paste mistake in a comment.
Florian Forster [Thu, 21 Feb 2013 09:35:59 +0000 (10:35 +0100)]
exec plugin: Fix a copy'n'paste mistake in a comment.

Thanks to Robert Riches Jr for the hint.

11 years agoAdd upstart configuration file for Ubuntu, Debian and RedHat distros
Dave Cottlehuber [Mon, 18 Feb 2013 12:31:57 +0000 (13:31 +0100)]
Add upstart configuration file for Ubuntu, Debian and RedHat distros

Signed-off-by: Florian Forster <octo@collectd.org>
11 years agoMerge branch 'mf/redhat' into collectd-5.2
Florian Forster [Wed, 20 Feb 2013 13:40:46 +0000 (14:40 +0100)]
Merge branch 'mf/redhat' into collectd-5.2

Fixes Github issue #220.

11 years agosnort plugin: Implement the "Instance" config option.
Florian Forster [Wed, 20 Feb 2013 13:36:15 +0000 (14:36 +0100)]
snort plugin: Implement the "Instance" config option.

11 years agosnort plugin: Assert that the configured "type" has only one data source.
Florian Forster [Wed, 20 Feb 2013 08:31:12 +0000 (09:31 +0100)]
snort plugin: Assert that the configured "type" has only one data source.

Also uses the utility function from configfile.h to read the metric
definition's name.

11 years agosnort plugin: Split the snort_read() function.
Florian Forster [Wed, 20 Feb 2013 08:14:15 +0000 (09:14 +0100)]
snort plugin: Split the snort_read() function.

snort_read() handles the file opening / mmap part of the process.
snort_read_buffer() parses the buffer, splits the last line and calls
the submit function. This way cleaning up the FD and memory mapping is
easier in case of an error when parsing the file.

11 years agosnort plugin: Improve error handling.
Florian Forster [Wed, 20 Feb 2013 08:06:39 +0000 (09:06 +0100)]
snort plugin: Improve error handling.

This prevents file descriptors and memory from leaking if something goes
wrong, e.g. the last line in the file is a comment.

11 years agosnort plugin: Replace strsep() (a BSD extension).
Florian Forster [Wed, 20 Feb 2013 07:54:46 +0000 (08:54 +0100)]
snort plugin: Replace strsep() (a BSD extension).

11 years agosnort plugin: Add a bounady check when reading from the metrics array.
Florian Forster [Wed, 20 Feb 2013 07:47:51 +0000 (08:47 +0100)]
snort plugin: Add a bounady check when reading from the metrics array.

Also renamed "count" to "metrics_num" to make it clear that the two
relate to one another.

11 years agocurl_json plugin: Call yajl_complete_parse() / yajl_parse_complete() only once.
Florian Forster [Wed, 20 Feb 2013 07:36:46 +0000 (08:36 +0100)]
curl_json plugin: Call yajl_complete_parse() / yajl_parse_complete() only once.

The cURL callback may be called several times, so we need to call the
complete() function after perform() returns.

11 years agoUpdated configuration directives.
Kris Nielander [Tue, 19 Feb 2013 22:36:14 +0000 (23:36 +0100)]
Updated configuration directives.
--

11 years agoRequested changes committed.
Kris Nielander [Mon, 18 Feb 2013 22:17:42 +0000 (23:17 +0100)]
Requested changes committed.

11 years agoRequested changes applied.
Kris Nielander [Thu, 14 Feb 2013 21:45:07 +0000 (22:45 +0100)]
Requested changes applied.

--

11 years agosnort plugin added
Kris Nielander [Sun, 10 Feb 2013 13:41:06 +0000 (14:41 +0100)]
snort plugin added

11 years agosrc/plugin.c: Use cdtime_t to calculate the sleep intervals.
Florian Forster [Wed, 6 Feb 2013 19:21:06 +0000 (20:21 +0100)]
src/plugin.c: Use cdtime_t to calculate the sleep intervals.

Since it's easier to do calculations with cdtime_t than struct timespec,
the code becomes easier to read and maintain.

11 years agoAdd protection from infinite redirect loops to curl-using plugins
Dan Fandrich [Mon, 4 Feb 2013 22:27:26 +0000 (23:27 +0100)]
Add protection from infinite redirect loops to curl-using plugins

Signed-off-by: Florian Forster <octo@collectd.org>
11 years agoFix a NULL pointer dereference during shutdown
Dan Fandrich [Mon, 4 Feb 2013 22:59:41 +0000 (23:59 +0100)]
Fix a NULL pointer dereference during shutdown

Signed-off-by: Florian Forster <octo@collectd.org>
11 years agocurl_xml plugin: Fix potential dereference of NULL pointer.
Dan Fandrich [Mon, 4 Feb 2013 23:02:17 +0000 (00:02 +0100)]
curl_xml plugin: Fix potential dereference of NULL pointer.

I managed to get collectd to segfault in a couple of places while
playing with it a bit. The first is in the curl_xml module when the
XPATH expression doesn't quite match the input. The crash occurs on line
407 when instance_node->nodeTab[0] is dereferenced. At this point, all
members of instance_node are 0, so dereferencing the array isn't a good
idea. This patch fixes the problem, although I'm not sure if this
particular case actually deserves its own error message.

Signed-off-by: Florian Forster <octo@collectd.org>
11 years agosrc/plugin.c: Initialize "next_read" field of read callbacks.
Florian Forster [Sun, 3 Feb 2013 22:04:17 +0000 (23:04 +0100)]
src/plugin.c: Initialize "next_read" field of read callbacks.

Fixes Github issue #230.

11 years agosrc/Makefile.am: Only add path to lcc_features.h to binaries linked against libcollec...
Florian Forster [Sun, 3 Feb 2013 12:10:35 +0000 (13:10 +0100)]
src/Makefile.am: Only add path to lcc_features.h to binaries linked against libcollectdclient.

11 years agoAllow out-of-tree builds
Dan Fandrich [Sat, 2 Feb 2013 00:26:43 +0000 (01:26 +0100)]
Allow out-of-tree builds

The generated header file lcc_features.h and collectd.h cause problems
otherwise.

Signed-off-by: Florian Forster <octo@collectd.org>
11 years agosrc/Makefile.am: Fix compilation of the riemann.proto file.
Florian Forster [Sun, 3 Feb 2013 10:40:21 +0000 (11:40 +0100)]
src/Makefile.am: Fix compilation of the riemann.proto file.

11 years agoMerge branch 'collectd-5.2'
Florian Forster [Sun, 3 Feb 2013 10:39:50 +0000 (11:39 +0100)]
Merge branch 'collectd-5.2'

11 years agoMerge branch 'collectd-5.1' into collectd-5.2
Florian Forster [Sun, 3 Feb 2013 10:36:48 +0000 (11:36 +0100)]
Merge branch 'collectd-5.1' into collectd-5.2

11 years agoMerge branch 'collectd-4.10' into collectd-5.1
Florian Forster [Sun, 3 Feb 2013 10:36:37 +0000 (11:36 +0100)]
Merge branch 'collectd-4.10' into collectd-5.1

Conflicts:
src/curl_json.c