rrdcached plugin: Refactor the configuration handling.
Remove a custom string handling function that's only used in one place and use
the functions provided by "configfile.h".
Remove a custom string handling function that's only used in one place and use
the functions provided by "configfile.h".
Merge remote-tracking branch 'github-tokkee/sh/empty-config'
oconfig: Allow empty statement lists (in blocks and files).
This allows to use empty blocks (which is useful during development and
testing) and empty files (which may happen when including config directories,
cf. Debian #592881).
In order not to generate a shift/reduce error, rather than allowing a
'statement_list' to be empty, this has been implemented by explicitly allowing
empty blocks and an empty 'entire_file'.
This allows to use empty blocks (which is useful during development and
testing) and empty files (which may happen when including config directories,
cf. Debian #592881).
In order not to generate a shift/reduce error, rather than allowing a
'statement_list' to be empty, this has been implemented by explicitly allowing
empty blocks and an empty 'entire_file'.
postgresql plugin: Added support for using the db instance as query parameter.
collectd.conf(5): Documented the <Database> "Instance" option of postgresql.
postgresql plugin: Added "Instance" option to <Database> config block.
This option may be used to specify the plugin instance that should be used
instead of the database name. This allows to query multiple databases of the
same name on the same host (e.g. when running multiple database server
versions in parallel).
This fixes GH #161 suggested by Bryan Varner.
This option may be used to specify the plugin instance that should be used
instead of the database name. This allows to query multiple databases of the
same name on the same host (e.g. when running multiple database server
versions in parallel).
This fixes GH #161 suggested by Bryan Varner.
Merge branch 'collectd-5.1'
Merge branch 'collectd-5.0' into collectd-5.1
Merge branch 'collectd-4.10' into collectd-5.0
Conflicts:
src/utils_db_query.c
src/utils_db_query.h
Conflicts:
src/utils_db_query.c
src/utils_db_query.h
disk plugin: Multiply the average read/write latency with the interval.
The counter/derive will later be divided by the interval, resulting in too
small rates (for interval > 1.0).
Should fix issue #150. Thanks to Manuel Sanmartin for identifying this problem!
The counter/derive will later be divided by the interval, resulting in too
small rates (for interval > 1.0).
Should fix issue #150. Thanks to Manuel Sanmartin for identifying this problem!
src/utils_format_graphite.[ch]: Add the "store_rates" option.
This functionality must have been lost in the refactoring that added
Graphite support to the AMQP plugin.
This functionality must have been lost in the refactoring that added
Graphite support to the AMQP plugin.
network.c: workaround for broken OSX compilers issuing false warnings
Signed-off-by: Florian Forster <octo@collectd.org>
Signed-off-by: Florian Forster <octo@collectd.org>
Merge branch 'collectd-5.1'
Merge remote-tracking branch 'origin/collectd-5.1' into collectd-5.1
Merge branch 'collectd-5.1'
src/utils_db_query.[ch]: Remove duplicate "const" modifier.
Merge branch 'collectd-5.0' into collectd-5.1
Conflicts:
src/snmp.c
Conflicts:
src/snmp.c
Merge branch 'collectd-4.10' into collectd-5.0
Conflicts:
src/snmp.c
Conflicts:
src/snmp.c
Merge branch 'ff/snmp' into collectd-4.10
src/ntpd.c: Write NAN if the peer was not reachable
src/utils_avltree.c: Fix an off-by-one error in c_avl_insert().
When inserting the first node in the tree, the size is not incremented.
This causes c_avl_size() to return one element too little.
Thanks to Yves Mettier for debugging this!
When inserting the first node in the tree, the size is not incremented.
This causes c_avl_size() to return one element too little.
Thanks to Yves Mettier for debugging this!
Bugfix (mutex unlock instead of lock)
rc/utils_cache.c: Allocate most of the memory required by uc_get_names() at once.
strdup() will still require additional memory, but no more memory movement like
required when doing realloc() a lot.
This fixes Github issue #148.
strdup() will still require additional memory, but no more memory movement like
required when doing realloc() a lot.
This fixes Github issue #148.
ntpd plugin: Make some arguments 'const'.
ntpd plugin: Refactor the peer name generation.
Break it out of the main read-loop and put it into two functions: One for the
reference clocks and one for network hosts. The reference clock code will call
the network host code when the clock name is not available in the internal list
of reference clock names. This eliminates the (thread-unsafe) usage of
inet_ntoa(3).
Break it out of the main read-loop and put it into two functions: One for the
reference clocks and one for network hosts. The reference clock code will call
the network host code when the clock name is not available in the internal list
of reference clock names. This eliminates the (thread-unsafe) usage of
inet_ntoa(3).
Document ntpd IncludeUnitID and add to default config
src/ntpd.c: Add IncludeUnitID option for backwards compatibility
src/ntpd.c: Format refclock name and unit ID with %s-%u
src/ntpd.c: Add unit number to refclock name
There can be multiple instances of the same refclock with different unit
numbers. The unit number needs to be a part of the peer name, otherwise
the code will try to write the measurements from multiple peers to the
same RRD file.
There can be multiple instances of the same refclock with different unit
numbers. The unit number needs to be a part of the peer name, otherwise
the code will try to write the measurements from multiple peers to the
same RRD file.
Merge branch 'ym/utils_cache_bugfix'
src/utils_cache.c: Fix comment re defining LISTVAL_INCREASE.
Using the preprocessor flags (CPPFLAGS) is a tad more correct I think.
Using the preprocessor flags (CPPFLAGS) is a tad more correct I think.
snmp plugin: Fix incorrect comparison in csnmp_oid_compare().
the increment is defined as a constant (#define) and will not be a
variable. So its names becomes uppercase.
variable. So its names becomes uppercase.
snmp plugin: Check the return value of csnmp_oid_suffix().
Also fix an issue where the complete OID is compared with only the suffix.
Thanks to Mark Juric to test the changes and point out these problems.
Issue: #131
Also fix an issue where the complete OID is compared with only the suffix.
Thanks to Mark Juric to test the changes and point out these problems.
Issue: #131
Add in swap plugin reserved, in and out values for AIX.
Signed-off-by: Florian Forster <octo@collectd.org>
Signed-off-by: Florian Forster <octo@collectd.org>
Merge branch 'mlsr/uptime-aix'
Add libperfstat in Makefile.am
Add AIX support for uptime plugin.
Fix typo in if and return
Fix link with perfstat
AIX suport in contextswitch plugin.
sequence_number is only used in linux.
Generate a compilation error.
Signed-off-by: Florian Forster <octo@collectd.org>
Generate a compilation error.
Signed-off-by: Florian Forster <octo@collectd.org>
The commit 3bda88e8b425f43644e303e6957e38ae59c1bc83 change the shell from sh to bash.
To fix the configure script generation error: remove the echo whith \c used in sh.
Note: bash is not installed in AIX by default.
Signed-off-by: Florian Forster <octo@collectd.org>
To fix the configure script generation error: remove the echo whith \c used in sh.
Note: bash is not installed in AIX by default.
Signed-off-by: Florian Forster <octo@collectd.org>
ARG_MAX on Solaris is *very* large, 2 MB. Allocating that much on the
stack (local variable) overflows the thread stack and crashes the
process in weird and interesting ways.
"int i" is a useless variable and breaks the build with -Werror.
Signed-off-by: Florian Forster <octo@collectd.org>
stack (local variable) overflows the thread stack and crashes the
process in weird and interesting ways.
"int i" is a useless variable and breaks the build with -Werror.
Signed-off-by: Florian Forster <octo@collectd.org>
snmp plugin: Fix iterating over tables without an instance configuration.
Also should fix incorrect handling of instance values; the first one would
be skipped.
Also should fix incorrect handling of instance values; the first one would
be skipped.
Performance improvment : uc_get_names now allocates memory by blocks and not element by element.
configure: Only set the Perl interpreter if the argument is a file.
This fixes Github issue #137.
This fixes Github issue #137.
Fixed bugs that prevented to "make distcheck"
Fixes Github issue #132.
Signed-off-by: Florian Forster <octo@collectd.org>
Fixes Github issue #132.
Signed-off-by: Florian Forster <octo@collectd.org>
processes plugin: Coding style and whitespace changes.
processes plugin: Use stack memory when reading the command line.
Also remove the call to the non-threadsafe strtok(3) call and fix the
size passed to sstrncpy().
Also remove the call to the non-threadsafe strtok(3) call and fix the
size passed to sstrncpy().
processes plugin: Call ps_submit_fork_rate() from read_fork_rate().
This avoids the "return ULONG_MAX" hack to signal a problem.
This avoids the "return ULONG_MAX" hack to signal a problem.
Buffer and memory allocation related bug fixes and changes
Replaced "free" with "sfree" for memory deallocation.
Added memset(...) to initialized newly allocated memory
Removed buffer "termination".
Replaced "free" with "sfree" for memory deallocation.
Added memset(...) to initialized newly allocated memory
Removed buffer "termination".
Added support for the Solaris OS processes
Added support for process information on the Solaris OS. The information comes mainly from
/proc/PID/status, /proc/PID/psinfo , /proc/PID/usage and kstat
Added a few "solaris" specific process states as well
Added support for process information on the Solaris OS. The information comes mainly from
/proc/PID/status, /proc/PID/psinfo , /proc/PID/usage and kstat
Added a few "solaris" specific process states as well
Merge branch 'collectd-5.1'
Merge branch 'collectd-5.0' into collectd-5.1
Merge branch 'collectd-4.10' into collectd-5.0
Conflicts:
src/utils_db_query.c
src/zfs_arc.c
Conflicts:
src/utils_db_query.c
src/zfs_arc.c
Fix for Solaris when setting ip-opt multicast-loop (must be a char, not int).
General logging additions for tracking down the problem.
Signed-off-by: Florian Forster <octo@collectd.org>
General logging additions for tracking down the problem.
Signed-off-by: Florian Forster <octo@collectd.org>
Multithreading fix: localize unneeded global variable
ethstat plugin: Initialize realloc'ated memory.
The last element in "interfaces" is not guaranteed to be zeroed, resulting in a
segfault when cf_util_get_string() tries to free the "pointer".
Thanks to Mark T. Voelker for reporting and analyzing this bug!
This should fix Github issue #133.
The last element in "interfaces" is not guaranteed to be zeroed, resulting in a
segfault when cf_util_get_string() tries to free the "pointer".
Thanks to Mark T. Voelker for reporting and analyzing this bug!
This should fix Github issue #133.
ethstat plugin: Fix off-by-one error.
This hopefully fixes Github issue #135.
This hopefully fixes Github issue #135.
snmp plugin: Improve subtree matching.
Some MIBs use subtrees with an unusual OID naming schema. For example,
some network hardware encodes the MAC address in the last six parts of
the OID. Previously, the code only checked the last part of the OID
("sub-id") and assumed this was increasing. This assumption is not true
in such naming schemas and is not required by SNMP. This patch fixes
this behavior by comparing the entire "OID suffix".
This hopefully fixes Github issue #131.
Some MIBs use subtrees with an unusual OID naming schema. For example,
some network hardware encodes the MAC address in the last six parts of
the OID. Previously, the code only checked the last part of the OID
("sub-id") and assumed this was increasing. This assumption is not true
in such naming schemas and is not required by SNMP. This patch fixes
this behavior by comparing the entire "OID suffix".
This hopefully fixes Github issue #131.
snmp plugin: Expand tabs.
snmp plugin: Rename a couple of confusing variables.
"head" and "tail" are way better names, I hope.
"head" and "tail" are way better names, I hope.
snmp plugin: Improve some comments.
libs varnish & varnishcompat are NOT needed. "pkg-config --libs varnishapi" output only libvarnishapi as well
Signed-off-by: Florian Forster <octo@collectd.org>
Signed-off-by: Florian Forster <octo@collectd.org>
bindings/Makefile: perl: Use INSTALL_BASE rather than PREFIX.
Some versions of Perl / ExtUtils::MakeMaker will else abort with an error
message explaining INSTALL_BASE and PREFIX may not be used both. However, I
don't know where the other definition comes from.
Signed-off-by: Florian Forster <octo@collectd.org>
Some versions of Perl / ExtUtils::MakeMaker will else abort with an error
message explaining INSTALL_BASE and PREFIX may not be used both. However, I
don't know where the other definition comes from.
Signed-off-by: Florian Forster <octo@collectd.org>
configure: Don't add -liptc to the global LIBS setting.
AC_SEARCH_LIBS() would do that, so save and restore LIBS when calling that
macro.
Signed-off-by: Florian Forster <octo@collectd.org>
AC_SEARCH_LIBS() would do that, so save and restore LIBS when calling that
macro.
Signed-off-by: Florian Forster <octo@collectd.org>
configure: Use AC_INCLUDES_DEFAULT when checking any libkvm stuff.
kvm.h requires sys/types.h to be included. Using AC_INCLUDES_DEFAULT will
hopefully make sure that we're save for a bit ;-)
Signed-off-by: Florian Forster <octo@collectd.org>
kvm.h requires sys/types.h to be included. Using AC_INCLUDES_DEFAULT will
hopefully make sure that we're save for a bit ;-)
Signed-off-by: Florian Forster <octo@collectd.org>
curl_xml plugin: Mark read-only strings as const.
fix Host config being ignored
Change-Id: I8a109818d8a821e2f3e0660fbb6ba1843279fcc2
Signed-off-by: Florian Forster <octo@collectd.org>
Change-Id: I8a109818d8a821e2f3e0660fbb6ba1843279fcc2
Signed-off-by: Florian Forster <octo@collectd.org>
apcups plugin: Retry sending the "status" command.
If that fails more than twice in the first 10 iterations, gracefully shut
down the socket in all future iterations.
This should fix Github issue #15.
If that fails more than twice in the first 10 iterations, gracefully shut
down the socket in all future iterations.
This should fix Github issue #15.
apcups plugin: Add function net_shutdown().
apcups plugin: Make sure the socket is closed on errors.
src/utils_db_query.c: Use the right field when checking for size.
swap plugin: Add the "ReportBytes" option.
When enabled, swap I/O is reported in bytes, not pages. Only valid for Linux.
This should fix Github issue #10.
When enabled, swap I/O is reported in bytes, not pages. Only valid for Linux.
This should fix Github issue #10.
Revert "swap plugin: Add the "ReportBytes" option."
This reverts commit 25fd1667c186eb871a4b66f9866d6446e41f1bc2.
This reverts commit 25fd1667c186eb871a4b66f9866d6446e41f1bc2.
swap plugin: Add the "ReportBytes" option.
When enabled, swap I/O is reported in bytes, not pages. Only valid for Linux.
This should fix Github issue #10.
When enabled, swap I/O is reported in bytes, not pages. Only valid for Linux.
This should fix Github issue #10.
exec plugin: Really remove STDERR from the select() set.
select(2) is actually using a variable called "copy", which we didn't set in
this case.
Fixes Github issue #12. Thanks to Tetsuya Kawaguchi for reporting this problem.
select(2) is actually using a variable called "copy", which we didn't set in
this case.
Fixes Github issue #12. Thanks to Tetsuya Kawaguchi for reporting this problem.
configure.in: Make sure sa_familiy_t is defined when checking rtnl_dump_filter().
netlink plugin: Check for the number of arguments to 'rtnl_dump_filter'.
In recent versions of iproute2, 'rtnl_dump_filter' expects three rather than
five arguments.
This should fix Github issue #7.
Signed-off-by: Florian Forster <octo@collectd.org>
In recent versions of iproute2, 'rtnl_dump_filter' expects three rather than
five arguments.
This should fix Github issue #7.
Signed-off-by: Florian Forster <octo@collectd.org>
Fixed collectd's unixsock read interrupted by SIGCHLD's.
Signed-off-by: Florian Forster <octo@collectd.org>
Signed-off-by: Florian Forster <octo@collectd.org>
Fixed various collectd memory leaks.
Once I understood what's going on I tried to keep the changes to a minimum.
Signed-off-by: Florian Forster <octo@collectd.org>
Once I understood what's going on I tried to keep the changes to a minimum.
Signed-off-by: Florian Forster <octo@collectd.org>
Merge branch 'ff/kstat' into collectd-4.10
Set license info line to ”GPLv2 or newer”
Recently I had a request to change the licensing of this file to
use it in a GPLv3 application. This change would make it easier,
while retaining GPLv2 to make the license still match the one in
collectd.
Signed-off-by: Florian Forster <octo@collectd.org>
Recently I had a request to change the licensing of this file to
use it in a GPLv3 application. This change would make it easier,
while retaining GPLv2 to make the license still match the one in
collectd.
Signed-off-by: Florian Forster <octo@collectd.org>
Merge branch 'collectd-5.1'
Merge branch 'collectd-5.0' into collectd-5.1
Conflicts:
src/swap.c
Conflicts:
src/swap.c
Merge branch 'collectd-4.10' into collectd-5.0
corrected high-resolution time conversions after code review
Signed-off-by: Florian Forster <octo@collectd.org>
Signed-off-by: Florian Forster <octo@collectd.org>
Updated Adrian Perez' 2009 Python network proto classes
Signed-off-by: Florian Forster <octo@collectd.org>
Signed-off-by: Florian Forster <octo@collectd.org>
snmp plugin: Fix error message printed by the "Shift" option.
I noticed a small error in snmp.c in collectd-5.1.0 (might be
elsewhere). The warning message in csnmp_config_add_data_shift says
"Scale config option" instead of "Shift" config option:
[…]
Signed-off-by: Florian Forster <octo@collectd.org>
I noticed a small error in snmp.c in collectd-5.1.0 (might be
elsewhere). The warning message in csnmp_config_add_data_shift says
"Scale config option" instead of "Shift" config option:
[…]
Signed-off-by: Florian Forster <octo@collectd.org>
df plugin: when checking / do it just once
Newer system symlink /etc/mtab to /proc/mounts which makes root
filesystem seem mounted twice, once as type rootfs and once for the
real device.
When / is selected for df plugin, skip the rootfs mount-point as
real root is usually mounted right on top of it.
Not skipping it causes rrdtool to complain about two updates for the
same timestamp, the first entry for rootfs passes but rrdtool complains
when stats for the second occurrence for real filesystem is being
considered.
Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org>
Signed-off-by: Florian Forster <octo@collectd.org>
Newer system symlink /etc/mtab to /proc/mounts which makes root
filesystem seem mounted twice, once as type rootfs and once for the
real device.
When / is selected for df plugin, skip the rootfs mount-point as
real root is usually mounted right on top of it.
Not skipping it causes rrdtool to complain about two updates for the
same timestamp, the first entry for rootfs passes but rrdtool complains
when stats for the second occurrence for real filesystem is being
considered.
Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org>
Signed-off-by: Florian Forster <octo@collectd.org>
snmp plugin: Check for SNMP_ENDOFMIBVIEW.
Some implementations of SNMP will send a special "variable" when you're
leaving the requested subtree with type "endOfMibView" aka.
"SNMP_ENDOFMIBVIEW". Examples of such implementations are Citrix
Netscalers and IBM's General Parallel File System (GPFS). Reading past
this special variable will result in weird values being returned.
This adds an appropriate check to csnmp_check_res_left_subtree().
Thanks to "Mark" for reporting this issue and clarifying.
Some implementations of SNMP will send a special "variable" when you're
leaving the requested subtree with type "endOfMibView" aka.
"SNMP_ENDOFMIBVIEW". Examples of such implementations are Citrix
Netscalers and IBM's General Parallel File System (GPFS). Reading past
this special variable will result in weird values being returned.
This adds an appropriate check to csnmp_check_res_left_subtree().
Thanks to "Mark" for reporting this issue and clarifying.
src/common.c: Add missing semicolon.
src/common.c: get_kstat_value: Check the arguments and return error codes.
Rather than asserting that an argument is not NULL, check this condition
and return an error code.
This should fix Github issue #71.
Rather than asserting that an argument is not NULL, check this condition
and return an error code.
This should fix Github issue #71.
src/Makefile.am: Unconditionally link collectd with libm.
Under FreeBSD, running src/utils_format_json.c fails because isfinite()
cannot be resolved. The GNU manpages for isnan() and isfinite() also
advise users to link with libm and AIX has had the library being linked
in for a while. Since it's such a basic library it seems easier to just
link with it unconditionally.
Fixes Github issue #122.
Under FreeBSD, running src/utils_format_json.c fails because isfinite()
cannot be resolved. The GNU manpages for isnan() and isfinite() also
advise users to link with libm and AIX has had the library being linked
in for a while. Since it's such a basic library it seems easier to just
link with it unconditionally.
Fixes Github issue #122.
Merge pull request #124 from tokkee/bj/build
Fix some build issues on AIX using automake <= 1.9 and gcc 4.7.1.
Fix some build issues on AIX using automake <= 1.9 and gcc 4.7.1.
Add missing return statements
Fix gcc warn/error: no return statement in function returning non-void [-Werror=return-type]
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Fix gcc warn/error: no return statement in function returning non-void [-Werror=return-type]
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Automake 1.9 compatibility: don't use $(builddir)
Automake <= 1.9 don't define $(builddir) which is always defined to
'.' anyway.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Automake <= 1.9 don't define $(builddir) which is always defined to
'.' anyway.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
src/collectd.conf.in: Update memcached config block.
memcached plugin: Fix some error messages.