Merge branch 'collectd-5.4' into collectd-5.5
configure.ac: fix libjvm detection on OSX
Shared libraries have the extension .dylib instead of .so
Ideally we look at shrext_cmds from libtool to find the shared library
extension but this works too.
Signed-off-by: Florian Forster <octo@collectd.org>
Shared libraries have the extension .dylib instead of .so
Ideally we look at shrext_cmds from libtool to find the shared library
extension but this works too.
Signed-off-by: Florian Forster <octo@collectd.org>
unixsock: check return value of chmod
CID #37948
Signed-off-by: Florian Forster <octo@collectd.org>
CID #37948
Signed-off-by: Florian Forster <octo@collectd.org>
zookeeper plugin: remove dead code
status cannot be 0 inside the loop
CID #37964
Signed-off-by: Florian Forster <octo@collectd.org>
status cannot be 0 inside the loop
CID #37964
Signed-off-by: Florian Forster <octo@collectd.org>
write_tsdb plugin: don't close a closed socket
CID #37979 and #37980
Signed-off-by: Florian Forster <octo@collectd.org>
CID #37979 and #37980
Signed-off-by: Florian Forster <octo@collectd.org>
zfs-arc plugin: check return value of malloc
CID #37989
Signed-off-by: Florian Forster <octo@collectd.org>
CID #37989
Signed-off-by: Florian Forster <octo@collectd.org>
bind plugin: plug small leak
CID #37992
Signed-off-by: Florian Forster <octo@collectd.org>
CID #37992
Signed-off-by: Florian Forster <octo@collectd.org>
curl_xml plugin: plug a few leaks on error
CID #37993
Signed-off-by: Florian Forster <octo@collectd.org>
CID #37993
Signed-off-by: Florian Forster <octo@collectd.org>
stats plugin: close fd on error
CID #37995
Signed-off-by: Florian Forster <octo@collectd.org>
CID #37995
Signed-off-by: Florian Forster <octo@collectd.org>
utils_cache.c: plug leak on error
CID #38000
Signed-off-by: Florian Forster <octo@collectd.org>
CID #38000
Signed-off-by: Florian Forster <octo@collectd.org>
Aggregration plugin: plug leak on error
CID #38005
Signed-off-by: Florian Forster <octo@collectd.org>
CID #38005
Signed-off-by: Florian Forster <octo@collectd.org>
varnish plugin: fix two resource leaks on error
CID #42774
Signed-off-by: Florian Forster <octo@collectd.org>
CID #42774
Signed-off-by: Florian Forster <octo@collectd.org>
write_riemann plugin: plug leak on error
CID #37996
Signed-off-by: Florian Forster <octo@collectd.org>
CID #37996
Signed-off-by: Florian Forster <octo@collectd.org>
libcollectdclient: free result of getaddrinfo
CID #37997
Signed-off-by: Florian Forster <octo@collectd.org>
CID #37997
Signed-off-by: Florian Forster <octo@collectd.org>
write_sensu plugin: fix two resource leaks on error
CID #37999
Signed-off-by: Florian Forster <octo@collectd.org>
CID #37999
Signed-off-by: Florian Forster <octo@collectd.org>
madwifi: make code a little bit clearer
buf2 is initialized to zero, readlink
will write at most sizeof(buf2) -1 bytes,
so the trailing null should not be overwritten.
Coverity doesn't see that, rewrite the code
differently so it does.
CID #38027
Signed-off-by: Florian Forster <octo@collectd.org>
buf2 is initialized to zero, readlink
will write at most sizeof(buf2) -1 bytes,
so the trailing null should not be overwritten.
Coverity doesn't see that, rewrite the code
differently so it does.
CID #38027
Signed-off-by: Florian Forster <octo@collectd.org>
Merge branch 'collectd-5.4' into collectd-5.5
Pinba plugin: close fd on error
CID #38001
Signed-off-by: Florian Forster <octo@collectd.org>
CID #38001
Signed-off-by: Florian Forster <octo@collectd.org>
configfile.c: close dir on error
CID #38006
Signed-off-by: Florian Forster <octo@collectd.org>
CID #38006
Signed-off-by: Florian Forster <octo@collectd.org>
turbostat plugin: close fd on error
Signed-off-by: Florian Forster <octo@collectd.org>
Signed-off-by: Florian Forster <octo@collectd.org>
utils_fbhash.c: fix resource leak on error
CID #38014
Signed-off-by: Florian Forster <octo@collectd.org>
CID #38014
Signed-off-by: Florian Forster <octo@collectd.org>
multimeter plugin: fix fd leak
If open returns 0 we leak fd.
CID #38016
Signed-off-by: Florian Forster <octo@collectd.org>
If open returns 0 we leak fd.
CID #38016
Signed-off-by: Florian Forster <octo@collectd.org>
postgresql plugin: don't exit on malloc failure
Signed-off-by: Florian Forster <octo@collectd.org>
Signed-off-by: Florian Forster <octo@collectd.org>
perl: Check for NULL before dereferencing
CID #38023
Signed-off-by: Florian Forster <octo@collectd.org>
CID #38023
Signed-off-by: Florian Forster <octo@collectd.org>
table plugin: fix check for realloc
We were checking the wrong thing.
CID #38024
Signed-off-by: Florian Forster <octo@collectd.org>
We were checking the wrong thing.
CID #38024
Signed-off-by: Florian Forster <octo@collectd.org>
utils_mount.c: check for null before dereferencing
CID #38025
Signed-off-by: Florian Forster <octo@collectd.org>
CID #38025
Signed-off-by: Florian Forster <octo@collectd.org>
utils_mount.c: check for null before dereferencing
CID #38025
Signed-off-by: Florian Forster <octo@collectd.org>
CID #38025
Signed-off-by: Florian Forster <octo@collectd.org>
zfs_arc plugin: leave enough room for terminating null
CID #38028
Signed-off-by: Florian Forster <octo@collectd.org>
CID #38028
Signed-off-by: Florian Forster <octo@collectd.org>
teamspeak2: fix potential use after close
If connecting to the last host fails, we exit the loop
with a closed fd, which we try to fdopen() later on.
CID #38038
Signed-off-by: Florian Forster <octo@collectd.org>
If connecting to the last host fails, we exit the loop
with a closed fd, which we try to fdopen() later on.
CID #38038
Signed-off-by: Florian Forster <octo@collectd.org>
threshold plugin: Register callbacks only once.
Fixes: #551
Signed-off-by: Florian Forster <octo@collectd.org>
Fixes: #551
Signed-off-by: Florian Forster <octo@collectd.org>
df plugin: Fix the duplicate detection.
Not that multiple devices could be mounted at the same mount point ... I think.
Fixes: #1402
Not that multiple devices could be mounted at the same mount point ... I think.
Fixes: #1402
df plugin: skip duplicate entries, fixes "uc_update: Value too old" error
Issue: #1402
Issue: #1402
ceph plugin: Rewrite handling of JSON state.
The previous code didn't handle non-numeric map values correctly,
leaking state and resulting in ridiculously long key strings. This
rewrite fixes this and adds a unit test to ensure that this is actually
working as intended.
Fixes: #1350
The previous code didn't handle non-numeric map values correctly,
leaking state and resulting in ridiculously long key strings. This
rewrite fixes this and adds a unit test to ensure that this is actually
working as intended.
Fixes: #1350
vmem plugin: Fix pgsteal for newer Linux kernels.
Fixes: #1307
Fixes: #1307
ceph plugin: Refactor ceph_cb_number().
The previous implementation was very prone to buffer overflows.
Fixes: #1350
The previous implementation was very prone to buffer overflows.
Fixes: #1350
Link collectd-tg with pthreads
Signed-off-by: Florian Forster <octo@collectd.org>
Signed-off-by: Florian Forster <octo@collectd.org>
Merge remote-tracking branch 'github/pr/1336' into collectd-5.5
memcached plugin: Use a DERIVE type for the "listen disabled" metric.
Fixes: #1356
Fixes: #1356
exec plugin: Revert file mode to 0644.
This fixes a regression from 94e562250296b1435e3e48cd302055d89c4c702b.
This fixes a regression from 94e562250296b1435e3e48cd302055d89c4c702b.
Merge branch 'collectd-5.4' into collectd-5.5
irq plugin: close file descriptor on failure
CID 38018
CID 38018
fhcount plugin: close file descriptor on failure
modbus plugin: fix 2 leaks on error paths
filecount plugin: fix leak on error path
ceph plugin: close fd on error
bind: tmp doesn't point to start of allocated memory
amqp: use the right buffer size for sstrncpy
buffer is a char *, not an array, so size_of returns the size
of the pointer.
buffer is a char *, not an array, so size_of returns the size
of the pointer.
powerdns plugin: fix array initialization
Fix build with older version of libprotobuf-c
gcrypt: take search path into account
gcrypt: remove exec-prefix check
libgcrypt-config --libs already includes the correct library include path.
Also, we hardcoded it to $exec-prefix/lib, which is just plain wrong on
64bit architectures.
libgcrypt-config --libs already includes the correct library include path.
Also, we hardcoded it to $exec-prefix/lib, which is just plain wrong on
64bit architectures.
protoc: check for headers in new location as well
Newer versions of protobuf-c have their headers in
/usr/include/protobuf-c, and a symlink from
/usr/include/google/protobuf-c/.
These symlinks will eventually disappear however, so be prepared.
Newer versions of protobuf-c have their headers in
/usr/include/protobuf-c, and a symlink from
/usr/include/google/protobuf-c/.
These symlinks will eventually disappear however, so be prepared.
protoc: check for libprotobuf-c as well
protoc: simplify configure check
protoc: slightly nicer output in silent mode
make[1]: Entering directory '/home/ruben/src/collectd/src'
PROTOC-C pinba.pb-c.c
PROTOC-C riemann.pb-c.c
make[1]: Entering directory '/home/ruben/src/collectd/src'
PROTOC-C pinba.pb-c.c
PROTOC-C riemann.pb-c.c
protoc: log when compiler is missing
In the case where we do have the required headers
but don't have the compiler, this makes it more clear
that we're missing the latter.
In the case where we do have the required headers
but don't have the compiler, this makes it more clear
that we're missing the latter.
Silence protoc-c in silence mode
Instead of showing the full command line, this shows:
GEN pinba.pb-c.c
GEN riemann.pb-c.c
Instead of showing the full command line, this shows:
GEN pinba.pb-c.c
GEN riemann.pb-c.c
write_riemann: only compile .proto files when enabled
If the write_riemann plugin is not enabled there's no
need to compile the protobuf files.
If the write_riemann plugin is not enabled there's no
need to compile the protobuf files.
Pinba: only compile .proto files when enabled
If the pinba plugin is not enabled there's no
need to compile the protobuf files.
If the pinba plugin is not enabled there's no
need to compile the protobuf files.
utils_mount: use reentrant getmntent_r when we can
Fixes #1162
Fixes #1162
Set locale environment variables at startup.
Fixes: #1237
Fixes: #1237
ntp plugin: Unify casting to gauge_t.
Also add note about STA_NANO.
Issue: #1314.
Also add note about STA_NANO.
Issue: #1314.
Fix NTP kerninfo offset/estimated error scaling
cpu plugin: Improve error message for host_processors() failing.
Issue: #22
Issue: #22
rrdtool: unlock mutex on error
CID 37972
Signed-off-by: Florian Forster <octo@collectd.org>
CID 37972
Signed-off-by: Florian Forster <octo@collectd.org>
csv plugin: plug memory leak on error
CID 38015
Signed-off-by: Florian Forster <octo@collectd.org>
CID 38015
Signed-off-by: Florian Forster <octo@collectd.org>
rrdtool: release another lock on error
CID 37973
Signed-off-by: Florian Forster <octo@collectd.org>
CID 37973
Signed-off-by: Florian Forster <octo@collectd.org>
ceph plugin: Rewrite parse_keys() and compact_ds_name().
This rewrite removes the logic to add the original length to the end of
the buffer in case of truncation. This logic was guarded by:
tmp[DATA_MAX_NAME_LEN - 1] = '\0';
if(strlen(tmp) > DATA_MAX_NAME_LEN - 1) { ... }
and was therefore dead code.
Fixes: #1350
This rewrite removes the logic to add the original length to the end of
the buffer in case of truncation. This logic was guarded by:
tmp[DATA_MAX_NAME_LEN - 1] = '\0';
if(strlen(tmp) > DATA_MAX_NAME_LEN - 1) { ... }
and was therefore dead code.
Fixes: #1350
ceph plugin: Add unit test for parse_keys().
This is used to demonstrate a buffer overflow: when the first part of a
key is >63 characters, key_chars_remaining underflows and causes a buffer
overflow in the following iteration.
Issue: #1350
This is used to demonstrate a buffer overflow: when the first part of a
key is >63 characters, key_chars_remaining underflows and causes a buffer
overflow in the following iteration.
Issue: #1350
the swrite interface is 'non-zero'
Signed-off-by: Florian Forster <octo@collectd.org>
Signed-off-by: Florian Forster <octo@collectd.org>
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>
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>
processes.c: plug memory leak in error path
Found with Infer (http://fbinfer.com/)
Signed-off-by: Florian Forster <octo@collectd.org>
Found with Infer (http://fbinfer.com/)
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
varnish: remove unused variable
This was used in a DEBUG statement I didn't check in.
This was used in a DEBUG statement I didn't check in.
varnish: rework v3 and v4 support
By using VSC_Iter() to loop over the list of metrics exposed by varnish,
we can pick those we're interested *if they are found*.
Not explicitly referring to metrics in the VSC_C_main struct makes the
plugin more resilient to small differences between minor varnish
versions.
It also opens the possibility to monitor non-MAIN metrics, such as
per-backend or per-storage engine stats.
This patch should be compatible with the previous way of doing, from the
user point of view.
Fix #1302
By using VSC_Iter() to loop over the list of metrics exposed by varnish,
we can pick those we're interested *if they are found*.
Not explicitly referring to metrics in the VSC_C_main struct makes the
plugin more resilient to small differences between minor varnish
versions.
It also opens the possibility to monitor non-MAIN metrics, such as
per-backend or per-storage engine stats.
This patch should be compatible with the previous way of doing, from the
user point of view.
Fix #1302
varnish: isolate varnish v2 code
Segregating v2-specific code will allow reworking the v3 and v4 parts,
while ensuring backwards compatibility with v2.
The downside is that this leads to a large chunk of mostly duplicate
code. That said, my suggestion would be to drop support for varnish v2
in collectd 5.6.
NB: this commit breaks v3 and v4 support.
Segregating v2-specific code will allow reworking the v3 and v4 parts,
while ensuring backwards compatibility with v2.
The downside is that this leads to a large chunk of mostly duplicate
code. That said, my suggestion would be to drop support for varnish v2
in collectd 5.6.
NB: this commit breaks v3 and v4 support.
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