snmp plugin: plug leak in error path.
Partial back port of #1368.
Signed-off-by: Florian Forster <octo@collectd.org>
Partial back port of #1368.
Signed-off-by: Florian Forster <octo@collectd.org>
utils_mount: use reentrant getmntent_r when we can
Fixes #1162
(cherry picked from commit a916ae72b89d0bcb5fe28d55def7327e8a1f6ce0)
Fixes #1162
(cherry picked from commit a916ae72b89d0bcb5fe28d55def7327e8a1f6ce0)
Merge branch 'collectd-5.4' into collectd-5.5
c_avl_pick needs to update the 'size' field of the tree when it deletes
a node.
Signed-off-by: Florian Forster <octo@collectd.org>
a node.
Signed-off-by: Florian Forster <octo@collectd.org>
Remove duplicate call to pthread_mutex_destroy.
statsd plugin: Correctly free metrics at shutdown.
The previous shutdown handler leaked "timer" and "set" metrics. This is
not a huge problem in itself, as the daemon is exiting shortly after
anyway, but it makes debugging of memory leaks very hard.
Issue: #997
The previous shutdown handler leaked "timer" and "set" metrics. This is
not a huge problem in itself, as the daemon is exiting shortly after
anyway, but it makes debugging of memory leaks very hard.
Issue: #997
apache plugin: DRY: use macro to determine number of fields.
apache: parse whole response, not only the first 16 lines
mod_status recently started reporting more statistics. According to
http://www.apache.org/dist/httpd/CHANGES_2.4 `mod_proxy, mod_ssl,
mod_cache_socache, mod_socache_*: Support machine readable server-status
produced when using the "?auto" query string.` for version 2.4.13
onwards.
As we can't assume everything we need will be included in the first 16
lines of output anymore, we now simply scan through the whole output.
mod_status recently started reporting more statistics. According to
http://www.apache.org/dist/httpd/CHANGES_2.4 `mod_proxy, mod_ssl,
mod_cache_socache, mod_socache_*: Support machine readable server-status
produced when using the "?auto" query string.` for version 2.4.13
onwards.
As we can't assume everything we need will be included in the first 16
lines of output anymore, we now simply scan through the whole output.
Remove POLLRDNORM (equivalent to POLLIN)
Checking for closed peer connection before send
Add utils_ignorelist back to daemon (#1323)
commit 216c6246b73645ac093de15b87aedc9abc6ebc80 moves the collectd
daemon files into the src/daemon/ directory, but also silently drops
utils_ignorelist. Dropping utils_ignorelist from the daemon has the
drawback that it cannot be used by plugins any more and that 16 plugins
need to bundle ignorelist.
Thus add utils_ignorelist back to the collectd daemon.
commit 216c6246b73645ac093de15b87aedc9abc6ebc80 moves the collectd
daemon files into the src/daemon/ directory, but also silently drops
utils_ignorelist. Dropping utils_ignorelist from the daemon has the
drawback that it cannot be used by plugins any more and that 16 plugins
need to bundle ignorelist.
Thus add utils_ignorelist back to the collectd daemon.
Merge branch 'collectd-5.4' into collectd-5.5
Fix clang complaining about extraneous parenthesis.
ASN_GAUGE (SNMP-SMIv2 Gauge32) is unsigned, not signed.
Start write threads after plugin initialization.
Some plugins such as "network" create own threads from within their
init callbacks which can then start submitting data to the queue
right away, even if the read threads haven't been started yet.
If write threads are started before plugin initialization, this can
result in a race where a plugin's write callback gets called before
that plugin's init callback has completed.
To fix this, delay starting the write threads until after all plugins
have been initialized.
Some plugins such as "network" create own threads from within their
init callbacks which can then start submitting data to the queue
right away, even if the read threads haven't been started yet.
If write threads are started before plugin initialization, this can
result in a race where a plugin's write callback gets called before
that plugin's init callback has completed.
To fix this, delay starting the write threads until after all plugins
have been initialized.
Merge branch 'collectd-5.4' into collectd-5.5
statsd: provide a gauge for counters, holding the absolute count.
When not using StoreRates false, this allows statsd aggregators
to hold on to the absolute count, if needed.
When not using StoreRates false, this allows statsd aggregators
to hold on to the absolute count, if needed.
Merge branch 'collectd-5.4' into collectd-5.5
battery: add missing capacity type to types.db
For the record, "capacity" was introduced by a2e732f8.
Also fix a bogus example in collectd.conf.
Thanks to @ryan-williams for reporting the problem !
Fix #1338
For the record, "capacity" was introduced by a2e732f8.
Also fix a bogus example in collectd.conf.
Thanks to @ryan-williams for reporting the problem !
Fix #1338
apcups: prefix plugin name in INFO and DEBUG statements
Fixes #1329
Fixes #1329
write_redis: fix a few typos in manpage
Also correct the maximum length of the node name.
The callback name is "write_redis/%s" so the maximum
length of a node name is DATA_MAX_NAME_LEN - strlen("write_redis") -1.
Also correct the maximum length of the node name.
The callback name is "write_redis/%s" so the maximum
length of a node name is DATA_MAX_NAME_LEN - strlen("write_redis") -1.
Merge branch 'collectd-5.4' into collectd-5.5
write_redis: remove unused variable from wr_write()
write_redis plugin: Remove old zadd command formatting code that should not be there to fix sorted set key names
collectd.conf.pod: correct a small typo
Fix a few typos in collectd-exec(5)
Merge branch 'collectd-5.4' into collectd-5.5
processes: correctly count processes on FreeBSD
because actually we count threads instead of processes
(partial backport of 85c31a6d66 for collectd-5.4 /mf)
because actually we count threads instead of processes
(partial backport of 85c31a6d66 for collectd-5.4 /mf)
Fix 'Modification of a read-only value attempted' error
processes: correctly count processes on {free,open}BSD
because actually we count threads instead of processes
because actually we count threads instead of processes
systemd.collectd.service: backport changes from master branch
python: Fix double-free bug.
Merge branch 'collectd-5.4' into collectd-5.5
gmond: fix linking against libganglia at build time
Current versions of libganglia don't ship the ganglia-config utility
anymore. Change the configure script to not expect it to be in $PATH and
provide sensible defaults instead.
Fix #1129
Current versions of libganglia don't ship the ganglia-config utility
anymore. Change the configure script to not expect it to be in $PATH and
provide sensible defaults instead.
Fix #1129
log_logstash: fix timestamp field to respect ISO 8601 format
Fixes #1132
Fixes #1132
Merge branch 'collectd-5.4' into collectd-5.5
PluginInterfaceFormat supports multiple fields
Document this.
Document this.
Don't access freed memory
The fields array contains pointers into the value_copy string.
The fields array contains pointers into the value_copy string.
Fix error message
mysql: use mysql_config --include for include path
According to the mysql_config manpage, --cflags shows the
compiler flags the library was compiled with. We certainly don't
want to use those.
According to the mysql_config manpage, --cflags shows the
compiler flags the library was compiled with. We certainly don't
want to use those.
mysql: just search for mysql_get_server_version
If we found that symbol, assume we also found mysql_init.
If we found that symbol, assume we also found mysql_init.
mysql: respect mysql_libs when searching for symbol
We always looked in libmysqlclient, but this doesn't
work for compatible databases such as Percona.
Respect the list return by mysql_config --libs_r instead.
Fixes #1098
We always looked in libmysqlclient, but this doesn't
work for compatible databases such as Percona.
Respect the list return by mysql_config --libs_r instead.
Fixes #1098
Fix copy-paste error in debug message in snmp plugin
Merge branch 'collectd-5.4' into collectd-5.5
Fix harmless build warnings with newer binutils
I see a lot of those on Rawhide:
ar: `u' modifier ignored since `D' is the default (see `U')
It's going to take a while to get this fixed upstream.
Meanwhile, silence the warnings.
Macro copied from libvirt.
I see a lot of those on Rawhide:
ar: `u' modifier ignored since `D' is the default (see `U')
It's going to take a while to get this fixed upstream.
Meanwhile, silence the warnings.
Macro copied from libvirt.
liboconfig: Fix implicit declaration warning
strlen declaration is in string.h
strlen declaration is in string.h
Don't unlock lock twice
Fixes make check on OpenBSD
Fixes make check on OpenBSD
pf: fix compilation on OpenBSD
dns: fix compilation on OpenBSD
OpenBSD doesn't have pcap-bpf.h
pcap.h has been including pcap/bpf.h since 2006.
Since we require a pcap which has PCAP_ERROR_IFACE_NOT_UP, introduced in 2008
this shouldn't break anything.
OpenBSD doesn't have pcap-bpf.h
pcap.h has been including pcap/bpf.h since 2006.
Since we require a pcap which has PCAP_ERROR_IFACE_NOT_UP, introduced in 2008
this shouldn't break anything.
Fix pipe leak in exec plugin
Fixes #762
Fixes #762
ltdl: only compile included libltdl when needed
If configure finds an external libltdl, it's going to
use it, so there's no use in compiling the shipped libltdl.
If configure finds an external libltdl, it's going to
use it, so there's no use in compiling the shipped libltdl.
Merge branch 'collectd-5.4' into collectd-5.5
routeros: fix a small build error pointed out by clang
routeros.c:334:35: error: 'memset' call operates on objects of type 'cr_data_t' (aka 'struct cr_data_s') while the size is based on a different type 'cr_data_t *' (aka 'struct cr_data_s *') [-Werror,-Wsizeof-pointer-memaccess]
memset (router_data, 0, sizeof (router_data));
~~~~~~~~~~~ ^~~~~~~~~~~
routeros.c:334:35: note: did you mean to dereference the argument to 'sizeof' (and multiply it by the number of elements)?
memset (router_data, 0, sizeof (router_data));
^~~~~~~~~~~
routeros.c:334:35: error: 'memset' call operates on objects of type 'cr_data_t' (aka 'struct cr_data_s') while the size is based on a different type 'cr_data_t *' (aka 'struct cr_data_s *') [-Werror,-Wsizeof-pointer-memaccess]
memset (router_data, 0, sizeof (router_data));
~~~~~~~~~~~ ^~~~~~~~~~~
routeros.c:334:35: note: did you mean to dereference the argument to 'sizeof' (and multiply it by the number of elements)?
memset (router_data, 0, sizeof (router_data));
^~~~~~~~~~~
ipc: enable _GNU_SOURCE to fix build with musl libc
This fixes compile the compile error:
> ipc.c:154:49: error: 'struct shm_info' has no member named 'used_ids'
> ipc_submit_g("shm", "segments", NULL, shm_info.used_ids);
> ^
Fixes #1147
This fixes compile the compile error:
> ipc.c:154:49: error: 'struct shm_info' has no member named 'used_ids'
> ipc_submit_g("shm", "segments", NULL, shm_info.used_ids);
> ^
Fixes #1147
Revert "amqp: look for librabbitmq in /usr/local as well"
This reverts commit c1c5087fd5d9e66427cee8c98c523519d578bee6.
... as a follow-up to the discussion which took place in #1201
This reverts commit c1c5087fd5d9e66427cee8c98c523519d578bee6.
... as a follow-up to the discussion which took place in #1201
fhcount: this plugin only works on Linux
Merge branch 'collectd-5.4' into collectd-5.5
logstash: initialize conf struct to 0
With YAJL 1 (at least on Ubuntu Precise), if `conf.indentString` is not
initialized correctly, we would get a segfault even when `conf.beautify`
is set to 0. We avoid this case by initializing the whole structure to
0. `conf.beautify = 0` is kept for explicitness.
With YAJL 1 (at least on Ubuntu Precise), if `conf.indentString` is not
initialized correctly, we would get a segfault even when `conf.beautify`
is set to 0. We avoid this case by initializing the whole structure to
0. `conf.beautify = 0` is kept for explicitness.
Fix libmodbus detection on FreeBSD
We look for modbus/modbus.h in /usr/local/include/modbus
but we should look for modbus.h
This is only an issue on FreeBSD since /usr/local/include is not
in the default search path.
We look for modbus/modbus.h in /usr/local/include/modbus
but we should look for modbus.h
This is only an issue on FreeBSD since /usr/local/include is not
in the default search path.
amqp: look for librabbitmq in /usr/local as well
This detects it automatically on FreeBSD.
Ideally we should just use pkg-config but that is
left as an exercise for the reader ;)
This detects it automatically on FreeBSD.
Ideally we should just use pkg-config but that is
left as an exercise for the reader ;)
Fix varnish detection on FreeBSD
We look for varnish/vapi/vsc.h in /usr/include/varnish
but we should look for vapi/vsc.h
This is only an issue on FreeBSD since /usr/local/include is not
in the default search path.
We look for varnish/vapi/vsc.h in /usr/include/varnish
but we should look for vapi/vsc.h
This is only an issue on FreeBSD since /usr/local/include is not
in the default search path.
irq: skip FIQ line in /proc/interrupts
/proc/interrupts on my Raspberry PI contains:
FIQ: usb_fiq
This line doesn't contain any per cpu counters
but we try to parse it anyway, resulting in:
parse_value: Failed to parse string as derive: usb_fiq.
Fixes #971
/proc/interrupts on my Raspberry PI contains:
FIQ: usb_fiq
This line doesn't contain any per cpu counters
but we try to parse it anyway, resulting in:
parse_value: Failed to parse string as derive: usb_fiq.
Fixes #971
configure.ac: remove some redundant x'es
configure.ac: fix indentation
Fix a memory leak on shutdown
Merge branch 'collectd-5.4' into collectd-5.5
Add utils_parse_option.c/h to amqp plugin source files list
collectd -T: fix memory leak
Fix some small leaks on error paths
liboconfig: really fix lex warnings
Flex has two options to disable input and unput.
Turn them on.
Flex has two options to disable input and unput.
Turn them on.
Add remark about length of HostnameFormat string in virt plugin
Use standard ints in write_kafka plugin for portability
src/utils_latency.c: Fix format string error.
src/utils_latency.c: Ensure that LLONG_MAX is defined.
EPEL5 doesn't have it in <limits.h> apparently.
EPEL5 doesn't have it in <limits.h> apparently.
src/utils_latency.c: Store "bin_width" as cdtime_t.
This solves the integer overflow when passing huge latency values to
latency_counter_add(). In addition to fixing the overflow the function
will now ignore values that are larger than LLONG_MAX, i.e. the longest
possible latency is 272 years. As a nice side-effect, the precission of
latency_counter_get_percentile() is improved.
Issue: #1131
This solves the integer overflow when passing huge latency values to
latency_counter_add(). In addition to fixing the overflow the function
will now ignore values that are larger than LLONG_MAX, i.e. the longest
possible latency is 272 years. As a nice side-effect, the precission of
latency_counter_get_percentile() is improved.
Issue: #1131
src/utils_latency.c: Fix change_bin_width().
A missing cast when calculating "width_change_ratio" caused all metrics to
be moved to bucket #0.
A missing cast when calculating "width_change_ratio" caused all metrics to
be moved to bucket #0.
varnish: fix leak on read
Since VSM_Close doesn't free the object we leak a few bytes
every interval
Since VSM_Close doesn't free the object we leak a few bytes
every interval
varnish: fix some leaks in error paths
fix leak on exit
plugin.c: plug leak on error
memcached: plug leak
gmond: plug a small leak on exit
collectd.conf.pod: correct a tiny typo
Merge branch 'collectd-5.4' into collectd-5.5
build: add libavltree, libcommon & libheap dependencies
Otherwise it can break on very parallel builds since collectd link time
arrives before one or more of these were built.
Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Otherwise it can break on very parallel builds since collectd link time
arrives before one or more of these were built.
Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Add test-suite logs to .gitignore
collectd.conf: order plugins alphabetically again
Fix Perl errors
"my" variable $cmd masks earlier declaration in same scope at /tmp/contrib_collectd2html.pl line 223.
syntax error at /tmp/contrib_collectd2html.pl line 219, near "$span qw(1hour 1day 1week 1month)"
Global symbol "$span" requires explicit package name at /tmp/contrib_collectd2html.pl line 221.
Global symbol "$span" requires explicit package name at /tmp/contrib_collectd2html.pl line 224.
Global symbol "$span" requires explicit package name at /tmp/contrib_collectd2html.pl line 225.
Global symbol "$span" requires explicit package name at /tmp/contrib_collectd2html.pl line 232.
Global symbol "$span" requires explicit package name at /tmp/contrib_collectd2html.pl line 237.
syntax error at /tmp/contrib_collectd2html.pl line 245, near "}"
"my" variable $cmd masks earlier declaration in same scope at /tmp/contrib_collectd2html.pl line 223.
syntax error at /tmp/contrib_collectd2html.pl line 219, near "$span qw(1hour 1day 1week 1month)"
Global symbol "$span" requires explicit package name at /tmp/contrib_collectd2html.pl line 221.
Global symbol "$span" requires explicit package name at /tmp/contrib_collectd2html.pl line 224.
Global symbol "$span" requires explicit package name at /tmp/contrib_collectd2html.pl line 225.
Global symbol "$span" requires explicit package name at /tmp/contrib_collectd2html.pl line 232.
Global symbol "$span" requires explicit package name at /tmp/contrib_collectd2html.pl line 237.
syntax error at /tmp/contrib_collectd2html.pl line 245, near "}"
bind: fix zone count check
Merge branch 'collectd-5.4' into collectd-5.5
src/daemon/common.c: Fix off-by-one error in escape_slashes().
Partial cherry-pick of 0cba91923be9326224f8434e4aae7691f7b6dad1.
Partial cherry-pick of 0cba91923be9326224f8434e4aae7691f7b6dad1.
properly handle error cases when kvm_read fails (#1094)
don't report inodes if fs doesn't provide f_files and f_ffree
write_redis plugin: Call freeReplyObject() for each redisReply.
barometer plugin: Fix "Allocator sizeof operand mismatch" warning.
write_sensu plugin: Fix debug message.
It still referenced the variables, which have been removed in
1c4008c3216edbc9c7cbeffd1c597c9b32e8f64d.
It still referenced the variables, which have been removed in
1c4008c3216edbc9c7cbeffd1c597c9b32e8f64d.
write_sensu plugin: Fix memory leak.
turbostat plugin: Fix "Undefined allocation of 0 bytes (CERT MEM04-C; CWE-131)" warning.