Change error message when read callback name is duplicated while registering it.
The message `Check for duplicate "LoadPlugin" lines` is obsolete, as there is a special check in `plugin_load()` for this case.
The message `Check for duplicate "LoadPlugin" lines` is obsolete, as there is a special check in `plugin_load()` for this case.
Free `userdata` if plugin_register_complex_read() has failed.
Merge remote-tracking branch 'github/pr/2276'
Merge pull request #2366 from axibase/ssnprintf-fix
Fix build: left ssnprintf in test
Fix build: left ssnprintf in test
Fix left ssnprintf in test
intel_rdt plugin: fix style
nut plugin: remove trailing whitespace
Merge branch 'ssnprintf-cleanup'
Conflicts:
src/dpdkevents.c
src/utils_dpdk.c
src/write_mongodb.c
Conflicts:
src/dpdkevents.c
src/utils_dpdk.c
src/write_mongodb.c
Run clang-format after removing ssnprintf
Changing ssnprintf to snprintf changed the indentation.
Changing ssnprintf to snprintf changed the indentation.
Merge pull request #2354 from rpv-tomsk/issue-2344-nut-rework
nut plugin: Multi-threaded ups polling with connect timeout.
nut plugin: Multi-threaded ups polling with connect timeout.
Merge pull request #2362 from rpv-tomsk/issue-2338
snmp_agent: Fixes and improvements
snmp_agent: Fixes and improvements
snmp_agent: Documented 'PluginInstance' option
snmp_agent: Changed plugin initialization
* Do not start working thread if plugin not configured.
That allows to avoid useless CPU consumption by polling loop.
* Do not register 'write' / 'missing' callbacks if there was no <Table> configured.
These callbacks do not do anything in this case.
* Registration of 'shutdown' callback delayed to 'init' phase.
* Do not start working thread if plugin not configured.
That allows to avoid useless CPU consumption by polling loop.
* Do not register 'write' / 'missing' callbacks if there was no <Table> configured.
These callbacks do not do anything in this case.
* Registration of 'shutdown' callback delayed to 'init' phase.
snmp_agent: Fix null pointer dereference
As `table` field in `data_definition_t` is just backreference,
then `snmp_agent_free_data()` should not alter parent structure.
So, table columns unregistering and freeing has moved to new
`snmp_agent_free_table_columns()` function.
That also fixes null pointer dereference.
Closes: #2338.
As `table` field in `data_definition_t` is just backreference,
then `snmp_agent_free_data()` should not alter parent structure.
So, table columns unregistering and freeing has moved to new
`snmp_agent_free_table_columns()` function.
That also fixes null pointer dereference.
Closes: #2338.
snmp_agent: Added a check for llist_create() result
Also appropriate `llist_destroy()` calls added.
Also appropriate `llist_destroy()` calls added.
snmp_agent: Avoid race conditions between thread start and locks initialization.
Lock initialization should be done before starting pthread which uses them.
Lock initialization should be done before starting pthread which uses them.
Merge branch 'collectd-5.7'
Conflicts:
contrib/systemd.collectd.service
Conflicts:
contrib/systemd.collectd.service
Merge branch 'collectd-5.6' into collectd-5.7
collectd.service: remove NoNewPrivileges setting
There are various issues with it in combination with SELinux.
See https://marc.info/?l=selinux&m=149971836431361&w=2 for some
background.
There are various issues with it in combination with SELinux.
See https://marc.info/?l=selinux&m=149971836431361&w=2 for some
background.
Merge pull request #2357 from rpv-tomsk/issue-2305
Fixed failed compilation on AIX
Fixed failed compilation on AIX
nut plugin: Multi-threaded ups polling with connect timeout.
Changes:
* Implemented use of 'plugin_register_complex_read', so querying will be multi-threaded;
* Added 'ConnectTimeout' option, implemented with use of 'upscli_tryconnect()' added in nut-2.6.2;
* The `upscli_cleanup()` should be called only at Collectd shutdown, excessive calls was removed;
* Added `upscli_init()` call if `ForceSSL` enabled.
* Added a check for duplicated values in `UPS` option.
Closes: #2344
Changes:
* Implemented use of 'plugin_register_complex_read', so querying will be multi-threaded;
* Added 'ConnectTimeout' option, implemented with use of 'upscli_tryconnect()' added in nut-2.6.2;
* The `upscli_cleanup()` should be called only at Collectd shutdown, excessive calls was removed;
* Added `upscli_init()` call if `ForceSSL` enabled.
* Added a check for duplicated values in `UPS` option.
Closes: #2344
Fixed failed compilation on AIX
Caused by typo in 2761915bed8c6caea41018be3e675aa712cc0b0a / #1842.
Closes: #2305
Caused by typo in 2761915bed8c6caea41018be3e675aa712cc0b0a / #1842.
Closes: #2305
write_mongodb: fix a couple of build warnings
CC src/write_mongodb_la-write_mongodb.lo
src/write_mongodb.c:96:21: warning: comparison of integers of different signs: 'int' and 'const size_t' (aka 'const unsigned long') [-Wsign-compare]
for (int i = 0; i < ds->ds_num; i++) {
~ ^ ~~~~~~~~~~
src/write_mongodb.c:121:21: warning: comparison of integers of different signs: 'int' and 'const size_t' (aka 'const unsigned long') [-Wsign-compare]
for (int i = 0; i < ds->ds_num; i++) {
~ ^ ~~~~~~~~~~
src/write_mongodb.c:134:21: warning: comparison of integers of different signs: 'int' and 'const size_t' (aka 'const unsigned long') [-Wsign-compare]
for (int i = 0; i < ds->ds_num; i++) {
~ ^ ~~~~~~~~~~
3 warnings generated.
CC src/write_mongodb_la-write_mongodb.lo
src/write_mongodb.c:96:21: warning: comparison of integers of different signs: 'int' and 'const size_t' (aka 'const unsigned long') [-Wsign-compare]
for (int i = 0; i < ds->ds_num; i++) {
~ ^ ~~~~~~~~~~
src/write_mongodb.c:121:21: warning: comparison of integers of different signs: 'int' and 'const size_t' (aka 'const unsigned long') [-Wsign-compare]
for (int i = 0; i < ds->ds_num; i++) {
~ ^ ~~~~~~~~~~
src/write_mongodb.c:134:21: warning: comparison of integers of different signs: 'int' and 'const size_t' (aka 'const unsigned long') [-Wsign-compare]
for (int i = 0; i < ds->ds_num; i++) {
~ ^ ~~~~~~~~~~
3 warnings generated.
chrony plugin: small cleanup
chrony plugin: fix 2 build warnings
CC src/chrony.lo
src/chrony.c:355:30: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
if (!isalnum(c) || j + 1 >= p_buf_size)
~~~~~ ^ ~~~~~~~~~~
src/chrony.c:359:9: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
if (j < p_buf_size)
~ ^ ~~~~~~~~~~
CC src/chrony.lo
src/chrony.c:355:30: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
if (!isalnum(c) || j + 1 >= p_buf_size)
~~~~~ ^ ~~~~~~~~~~
src/chrony.c:359:9: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
if (j < p_buf_size)
~ ^ ~~~~~~~~~~
Merge pull request #2351 from rpv-tomsk/apcups-defaults
apcups: allow to use plugin without explicit configuration
apcups: allow to use plugin without explicit configuration
apcups: allow to use plugin without explicit configuration
Previously the apcups plugin could not be used without defining
an explicit configuration.
While the apcups plugin did provide a localhost fallback, it
did not however provide a 3551 port fallback in practice,
eventhough a constant for that purpose was already present.
Thanks to Pascal de Bruijn for report.
Closes: #2347
Previously the apcups plugin could not be used without defining
an explicit configuration.
While the apcups plugin did provide a localhost fallback, it
did not however provide a 3551 port fallback in practice,
eventhough a constant for that purpose was already present.
Thanks to Pascal de Bruijn for report.
Closes: #2347
Merge branch 'collectd-5.7'
Fixes #2328
Conflicts:
src/curl_json.c
src/curl_xml.c
Fixes #2328
Conflicts:
src/curl_json.c
src/curl_xml.c
Merge branch 'collectd-5.6' into collectd-5.7
snmp_agent: fix format specifiers
make all-am
make[1]: Entering directory '/home/ruben/src/collectd'
CC src/snmp_agent_la-snmp_agent.lo
In file included from ./src/daemon/common.h:33:0,
from src/snmp_agent.c:31:
src/snmp_agent.c: In function ‘snmp_agent_dump_data’:
src/snmp_agent.c:42:21: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘size_t {aka long unsigned int}’ [-Wformat=]
#define PLUGIN_NAME "snmp_agent"
^
./src/daemon/plugin.h:400:42: note: in definition of macro ‘DEBUG’
#define DEBUG(...) plugin_log(LOG_DEBUG, __VA_ARGS__)
^~~~~~~~~~~
src/snmp_agent.c:192:13: note: in expansion of macro ‘PLUGIN_NAME’
DEBUG(PLUGIN_NAME ": OID[%d]: %s", i, oid_str);
^~~~~~~~~~~
src/snmp_agent.c:192:35: note: format string is defined here
DEBUG(PLUGIN_NAME ": OID[%d]: %s", i, oid_str);
~^
%ld
CCLD snmp_agent.la
make all-am
make[1]: Entering directory '/home/ruben/src/collectd'
CC src/snmp_agent_la-snmp_agent.lo
In file included from ./src/daemon/common.h:33:0,
from src/snmp_agent.c:31:
src/snmp_agent.c: In function ‘snmp_agent_dump_data’:
src/snmp_agent.c:42:21: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘size_t {aka long unsigned int}’ [-Wformat=]
#define PLUGIN_NAME "snmp_agent"
^
./src/daemon/plugin.h:400:42: note: in definition of macro ‘DEBUG’
#define DEBUG(...) plugin_log(LOG_DEBUG, __VA_ARGS__)
^~~~~~~~~~~
src/snmp_agent.c:192:13: note: in expansion of macro ‘PLUGIN_NAME’
DEBUG(PLUGIN_NAME ": OID[%d]: %s", i, oid_str);
^~~~~~~~~~~
src/snmp_agent.c:192:35: note: format string is defined here
DEBUG(PLUGIN_NAME ": OID[%d]: %s", i, oid_str);
~^
%ld
CCLD snmp_agent.la
Merge pull request #2348 from maryamtahhan/feat_dpdkevents_fixes
Feat dpdkevents fixes
Feat dpdkevents fixes
dpdk plugins: bug fixes and improvements
- Do not return error in configuration callback, which will cause
collectd to be stopped. Instead, report error in init callback, which
will unload incorrectly configured plugin.
- Remove redundant ProcessType configuration option, which was always set to
"secondary"
- Use functions from cf_util_get family for parsing config file
- In case of parsing errors perform plugin cleanup
- Correctly remove previously created shared memory object if user specified
"SharedMemObj" option with different value than default
- Prevent segmentation fault in dpdk_shm_cleanup
- Change 'send_updated' and 'notify' variable types to _Bool
Change-Id: Id7dfc7f25d2cebf332d47bcd5afaaebf577945d6
Signed-off-by: Przemyslaw Szczerbik <przemyslawx.szczerbik@intel.com>
- Do not return error in configuration callback, which will cause
collectd to be stopped. Instead, report error in init callback, which
will unload incorrectly configured plugin.
- Remove redundant ProcessType configuration option, which was always set to
"secondary"
- Use functions from cf_util_get family for parsing config file
- In case of parsing errors perform plugin cleanup
- Correctly remove previously created shared memory object if user specified
"SharedMemObj" option with different value than default
- Prevent segmentation fault in dpdk_shm_cleanup
- Change 'send_updated' and 'notify' variable types to _Bool
Change-Id: Id7dfc7f25d2cebf332d47bcd5afaaebf577945d6
Signed-off-by: Przemyslaw Szczerbik <przemyslawx.szczerbik@intel.com>
dpdkevents: initialization fixes
This patch removes impact of keep_alive init failure on
link_status processing. Also changed default behaviour in configless
mode, where no <Plugin/> stanza is defined. Now both keep_alive
and link_status are enabled by default. On the other hand if
<Plugin/> stanza is present, both features are disabled by default
and user is responsible for specifying which one is active or not.
Change-Id: I03f7ab88e89404e03532677d00a966ddb80d1552
Signed-off-by: Krzysztof Matczak <krzysztofx.matczak@intel.com>
This patch removes impact of keep_alive init failure on
link_status processing. Also changed default behaviour in configless
mode, where no <Plugin/> stanza is defined. Now both keep_alive
and link_status are enabled by default. On the other hand if
<Plugin/> stanza is present, both features are disabled by default
and user is responsible for specifying which one is active or not.
Change-Id: I03f7ab88e89404e03532677d00a966ddb80d1552
Signed-off-by: Krzysztof Matczak <krzysztofx.matczak@intel.com>
dpdkevents: detect primary DPDK application (re)start
Current implementation attempts to open KA SHM only once during init callback.
If at the time primary DPDK application is not running shm_open will fail, which
will result in dpdkevents plugin being unloaded. Move KA SHM open logic to read
callback to allow plugin to attach to primary DPDK application later without a
need to restart collectd. Moreover, it will allow to determine if primary DPDK
application was killed and plugin should stop dispatching KA statistics.
Additionally modify dpdk_event_keep_alive_shm_open function to detect restart of
primary DPDK application. When primary DPDK application (with KA support) is
restarted it unlinks existing shared memory object and creates a new one. It's
necessary for the plugin to create a new SHM mapping in order to prevent reading
statistics from stale SHM block.
Change-Id: I7fc0047ba117db771ada58a40cbe0b2bddd00112
Signed-off-by: Przemyslaw Szczerbik <przemyslawx.szczerbik@intel.com>
Current implementation attempts to open KA SHM only once during init callback.
If at the time primary DPDK application is not running shm_open will fail, which
will result in dpdkevents plugin being unloaded. Move KA SHM open logic to read
callback to allow plugin to attach to primary DPDK application later without a
need to restart collectd. Moreover, it will allow to determine if primary DPDK
application was killed and plugin should stop dispatching KA statistics.
Additionally modify dpdk_event_keep_alive_shm_open function to detect restart of
primary DPDK application. When primary DPDK application (with KA support) is
restarted it unlinks existing shared memory object and creates a new one. It's
necessary for the plugin to create a new SHM mapping in order to prevent reading
statistics from stale SHM block.
Change-Id: I7fc0047ba117db771ada58a40cbe0b2bddd00112
Signed-off-by: Przemyslaw Szczerbik <przemyslawx.szczerbik@intel.com>
Merge pull request #2341 from rpv-tomsk/issue-2328
curl plugins: Use configured URL for all poll cycles
curl plugins: Use configured URL for all poll cycles
curl plugins: Use configured URL for all poll cycles
After redirect received, Collectd send subsequent requests to new location.
That is wrong - Collectd should use configured URL for all poll cycles, regardless of the responses received previously.
Problem was caused by libcurl issue 1631. To avoid that we set request url in each poll cycle.
Closes: #2328
After redirect received, Collectd send subsequent requests to new location.
That is wrong - Collectd should use configured URL for all poll cycles, regardless of the responses received previously.
Problem was caused by libcurl issue 1631. To avoid that we set request url in each poll cycle.
Closes: #2328
write_mongodb: fix build warning
CC src/write_mongodb_la-write_mongodb.lo
src/write_mongodb.c: In function ‘wm_config’:
src/write_mongodb.c:371:55: warning: ‘%s’ directive output may be truncated writing up to 127 bytes into a region of size 114 [-Wformat-truncation=]
snprintf(cb_name, sizeof(cb_name), "write_mongodb/%s", node->name);
^~
src/write_mongodb.c:371:5: note: ‘snprintf’ output between 15 and 142 bytes into a destination of size 128
snprintf(cb_name, sizeof(cb_name), "write_mongodb/%s", node->name);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CC src/write_mongodb_la-write_mongodb.lo
src/write_mongodb.c: In function ‘wm_config’:
src/write_mongodb.c:371:55: warning: ‘%s’ directive output may be truncated writing up to 127 bytes into a region of size 114 [-Wformat-truncation=]
snprintf(cb_name, sizeof(cb_name), "write_mongodb/%s", node->name);
^~
src/write_mongodb.c:371:5: note: ‘snprintf’ output between 15 and 142 bytes into a destination of size 128
snprintf(cb_name, sizeof(cb_name), "write_mongodb/%s", node->name);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
write_redis: fix build warning
src/write_redis.c: In function ‘wr_config’:
src/write_redis.c:222:53: warning: ‘%s’ directive output may be truncated writing up to 127 bytes into a region of size 116 [-Wformat-truncation=]
snprintf(cb_name, sizeof(cb_name), "write_redis/%s", node->name);
^~
src/write_redis.c:222:5: note: ‘snprintf’ output between 13 and 140 bytes into a destination of size 128
snprintf(cb_name, sizeof(cb_name), "write_redis/%s", node->name);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/write_redis.c: In function ‘wr_config’:
src/write_redis.c:222:53: warning: ‘%s’ directive output may be truncated writing up to 127 bytes into a region of size 116 [-Wformat-truncation=]
snprintf(cb_name, sizeof(cb_name), "write_redis/%s", node->name);
^~
src/write_redis.c:222:5: note: ‘snprintf’ output between 13 and 140 bytes into a destination of size 128
snprintf(cb_name, sizeof(cb_name), "write_redis/%s", node->name);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libcollectdclient: increase error buffer
make[1]: Entering directory '/home/ruben/src/collectd'
CC src/libcollectdclient/libcollectdclient_la-client.lo
src/libcollectdclient/client.c: In function ‘lcc_getval’:
src/libcollectdclient/client.c:621:23: warning: ‘%s’ directive output may be truncated writing up to 1023 bytes into a region of size 1010 [-Wformat-truncation=]
LCC_SET_ERRSTR(c, "Server error: %s", res.message);
^ ~
src/libcollectdclient/client.c:94:48: note: in definition of macro ‘LCC_SET_ERRSTR’
snprintf((c)->errbuf, sizeof((c)->errbuf), __VA_ARGS__); \
^~~~~~~~~~~
src/libcollectdclient/client.c:94:5: note: ‘snprintf’ output between 15 and 1038 bytes into a destination of size 1024
snprintf((c)->errbuf, sizeof((c)->errbuf), __VA_ARGS__); \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/libcollectdclient/client.c:621:5: note: in expansion of macro ‘LCC_SET_ERRSTR’
LCC_SET_ERRSTR(c, "Server error: %s", res.message);
^~~~~~~~~~~~~~
src/libcollectdclient/client.c: In function ‘lcc_putval’:
src/libcollectdclient/client.c:754:23: warning: ‘%s’ directive output may be truncated writing up to 1023 bytes into a region of size 1010 [-Wformat-truncation=]
LCC_SET_ERRSTR(c, "Server error: %s", res.message);
^ ~
src/libcollectdclient/client.c:94:48: note: in definition of macro ‘LCC_SET_ERRSTR’
snprintf((c)->errbuf, sizeof((c)->errbuf), __VA_ARGS__); \
^~~~~~~~~~~
src/libcollectdclient/client.c:94:5: note: ‘snprintf’ output between 15 and 1038 bytes into a destination of size 1024
snprintf((c)->errbuf, sizeof((c)->errbuf), __VA_ARGS__); \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/libcollectdclient/client.c:754:5: note: in expansion of macro ‘LCC_SET_ERRSTR’
LCC_SET_ERRSTR(c, "Server error: %s", res.message);
^~~~~~~~~~~~~~
src/libcollectdclient/client.c: In function ‘lcc_flush’:
src/libcollectdclient/client.c:802:23: warning: ‘%s’ directive output may be truncated writing up to 1023 bytes into a region of size 1010 [-Wformat-truncation=]
LCC_SET_ERRSTR(c, "Server error: %s", res.message);
^ ~
src/libcollectdclient/client.c:94:48: note: in definition of macro ‘LCC_SET_ERRSTR’
snprintf((c)->errbuf, sizeof((c)->errbuf), __VA_ARGS__); \
^~~~~~~~~~~
src/libcollectdclient/client.c:94:5: note: ‘snprintf’ output between 15 and 1038 bytes into a destination of size 1024
snprintf((c)->errbuf, sizeof((c)->errbuf), __VA_ARGS__); \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/libcollectdclient/client.c:802:5: note: in expansion of macro ‘LCC_SET_ERRSTR’
LCC_SET_ERRSTR(c, "Server error: %s", res.message);
^~~~~~~~~~~~~~
src/libcollectdclient/client.c: In function ‘lcc_listval’:
src/libcollectdclient/client.c:834:23: warning: ‘%s’ directive output may be truncated writing up to 1023 bytes into a region of size 1010 [-Wformat-truncation=]
LCC_SET_ERRSTR(c, "Server error: %s", res.message);
^ ~
src/libcollectdclient/client.c:94:48: note: in definition of macro ‘LCC_SET_ERRSTR’
snprintf((c)->errbuf, sizeof((c)->errbuf), __VA_ARGS__); \
^~~~~~~~~~~
src/libcollectdclient/client.c:94:5: note: ‘snprintf’ output between 15 and 1038 bytes into a destination of size 1024
snprintf((c)->errbuf, sizeof((c)->errbuf), __VA_ARGS__); \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/libcollectdclient/client.c:834:5: note: in expansion of macro ‘LCC_SET_ERRSTR’
LCC_SET_ERRSTR(c, "Server error: %s", res.message);
^~~~~~~~~~~~~~
Fixes #2200
make[1]: Entering directory '/home/ruben/src/collectd'
CC src/libcollectdclient/libcollectdclient_la-client.lo
src/libcollectdclient/client.c: In function ‘lcc_getval’:
src/libcollectdclient/client.c:621:23: warning: ‘%s’ directive output may be truncated writing up to 1023 bytes into a region of size 1010 [-Wformat-truncation=]
LCC_SET_ERRSTR(c, "Server error: %s", res.message);
^ ~
src/libcollectdclient/client.c:94:48: note: in definition of macro ‘LCC_SET_ERRSTR’
snprintf((c)->errbuf, sizeof((c)->errbuf), __VA_ARGS__); \
^~~~~~~~~~~
src/libcollectdclient/client.c:94:5: note: ‘snprintf’ output between 15 and 1038 bytes into a destination of size 1024
snprintf((c)->errbuf, sizeof((c)->errbuf), __VA_ARGS__); \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/libcollectdclient/client.c:621:5: note: in expansion of macro ‘LCC_SET_ERRSTR’
LCC_SET_ERRSTR(c, "Server error: %s", res.message);
^~~~~~~~~~~~~~
src/libcollectdclient/client.c: In function ‘lcc_putval’:
src/libcollectdclient/client.c:754:23: warning: ‘%s’ directive output may be truncated writing up to 1023 bytes into a region of size 1010 [-Wformat-truncation=]
LCC_SET_ERRSTR(c, "Server error: %s", res.message);
^ ~
src/libcollectdclient/client.c:94:48: note: in definition of macro ‘LCC_SET_ERRSTR’
snprintf((c)->errbuf, sizeof((c)->errbuf), __VA_ARGS__); \
^~~~~~~~~~~
src/libcollectdclient/client.c:94:5: note: ‘snprintf’ output between 15 and 1038 bytes into a destination of size 1024
snprintf((c)->errbuf, sizeof((c)->errbuf), __VA_ARGS__); \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/libcollectdclient/client.c:754:5: note: in expansion of macro ‘LCC_SET_ERRSTR’
LCC_SET_ERRSTR(c, "Server error: %s", res.message);
^~~~~~~~~~~~~~
src/libcollectdclient/client.c: In function ‘lcc_flush’:
src/libcollectdclient/client.c:802:23: warning: ‘%s’ directive output may be truncated writing up to 1023 bytes into a region of size 1010 [-Wformat-truncation=]
LCC_SET_ERRSTR(c, "Server error: %s", res.message);
^ ~
src/libcollectdclient/client.c:94:48: note: in definition of macro ‘LCC_SET_ERRSTR’
snprintf((c)->errbuf, sizeof((c)->errbuf), __VA_ARGS__); \
^~~~~~~~~~~
src/libcollectdclient/client.c:94:5: note: ‘snprintf’ output between 15 and 1038 bytes into a destination of size 1024
snprintf((c)->errbuf, sizeof((c)->errbuf), __VA_ARGS__); \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/libcollectdclient/client.c:802:5: note: in expansion of macro ‘LCC_SET_ERRSTR’
LCC_SET_ERRSTR(c, "Server error: %s", res.message);
^~~~~~~~~~~~~~
src/libcollectdclient/client.c: In function ‘lcc_listval’:
src/libcollectdclient/client.c:834:23: warning: ‘%s’ directive output may be truncated writing up to 1023 bytes into a region of size 1010 [-Wformat-truncation=]
LCC_SET_ERRSTR(c, "Server error: %s", res.message);
^ ~
src/libcollectdclient/client.c:94:48: note: in definition of macro ‘LCC_SET_ERRSTR’
snprintf((c)->errbuf, sizeof((c)->errbuf), __VA_ARGS__); \
^~~~~~~~~~~
src/libcollectdclient/client.c:94:5: note: ‘snprintf’ output between 15 and 1038 bytes into a destination of size 1024
snprintf((c)->errbuf, sizeof((c)->errbuf), __VA_ARGS__); \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/libcollectdclient/client.c:834:5: note: in expansion of macro ‘LCC_SET_ERRSTR’
LCC_SET_ERRSTR(c, "Server error: %s", res.message);
^~~~~~~~~~~~~~
Fixes #2200
libcollectclient: snprintf already NUL-terminates
processes plugin: fix build warning
CC src/processes.lo
src/processes.c: In function ‘ps_read’:
src/processes.c:823:58: warning: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size between 32 and 51 [-Wformat-truncation=]
snprintf(filename, sizeof(filename), "/proc/%li/task/%s/status", ps->id,
^~
src/processes.c:823:5: note: ‘snprintf’ output between 21 and 295 bytes into a destination of size 64
snprintf(filename, sizeof(filename), "/proc/%li/task/%s/status", ps->id,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tpid);
~~~~~
In practice the buffer is more than large enough, since all we substitute are process ids, but gcc can't know that.
CC src/processes.lo
src/processes.c: In function ‘ps_read’:
src/processes.c:823:58: warning: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size between 32 and 51 [-Wformat-truncation=]
snprintf(filename, sizeof(filename), "/proc/%li/task/%s/status", ps->id,
^~
src/processes.c:823:5: note: ‘snprintf’ output between 21 and 295 bytes into a destination of size 64
snprintf(filename, sizeof(filename), "/proc/%li/task/%s/status", ps->id,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tpid);
~~~~~
In practice the buffer is more than large enough, since all we substitute are process ids, but gcc can't know that.
Treewide: replace ssnprintf with snprintf
ssnprintf supposedly was a safer version of snprintf, but they both
always NUL-terminate the buffer.
After this change GCC >= 7 will start warning when snprintf silenty
truncates, which is good since I want to see when that happens.
ssnprintf supposedly was a safer version of snprintf, but they both
always NUL-terminate the buffer.
After this change GCC >= 7 will start warning when snprintf silenty
truncates, which is good since I want to see when that happens.
Merge branch 'collectd-5.7'
tcpconns plugin: fix build on FreeBSD current
FreeBSD commit https://github.com/freebsd/freebsd/commit/3a5c9aaf2b2ea107bcaf0ba28b706238d92bdbbd
hides inpcb and tcpcb from userland.
Patch taken from FreeBSD ports tree, thanks glebius@.
FreeBSD commit https://github.com/freebsd/freebsd/commit/3a5c9aaf2b2ea107bcaf0ba28b706238d92bdbbd
hides inpcb and tcpcb from userland.
Patch taken from FreeBSD ports tree, thanks glebius@.
write_mongodb: use ssnprintf_alloc to create dsn
write_mongodb: fix potential NULL dereference
scan-build: Using '/usr/bin/clang-4.0' for static analysis
make all-am
make[1]: Entering directory '/home/ruben/src/collectd'
CC src/write_mongodb_la-write_mongodb.lo
src/write_mongodb.c:173:41: warning: Null pointer passed as an argument to a 'nonnull' parameter
strlen(node->passwd) + strlen(node->host) + 5 +
^~~~~~~~~~~~~~~~~~
src/write_mongodb.c:199:42: warning: Null pointer passed as an argument to a 'nonnull' parameter
uri_length = strlen(format_string) + strlen(node->host) + 5 + 1;
^~~~~~~~~~~~~~~~~~
2 warnings generated.
CCLD write_mongodb.la
scan-build: Using '/usr/bin/clang-4.0' for static analysis
make all-am
make[1]: Entering directory '/home/ruben/src/collectd'
CC src/write_mongodb_la-write_mongodb.lo
src/write_mongodb.c:173:41: warning: Null pointer passed as an argument to a 'nonnull' parameter
strlen(node->passwd) + strlen(node->host) + 5 +
^~~~~~~~~~~~~~~~~~
src/write_mongodb.c:199:42: warning: Null pointer passed as an argument to a 'nonnull' parameter
uri_length = strlen(format_string) + strlen(node->host) + 5 + 1;
^~~~~~~~~~~~~~~~~~
2 warnings generated.
CCLD write_mongodb.la
write_mongodb.c: clang-format
Only build libplugin_mock.la during make check
Merge pull request #2315 from mcorbin/feat/riemann-microseconds-resolution
Add micro-seconds resolution in write_riemann
Add micro-seconds resolution in write_riemann
Merge pull request #2301 from rpv-tomsk/fix-apcups
apcups: Fix reconnect implementation
apcups: Fix reconnect implementation
ipvs plugin: remove custom kernel source support
Linux has shipped ipvs.h in its uapi for ages now.
Linux has shipped ipvs.h in its uapi for ages now.
configure.ac: minor cleanup
configure.ac: remove some whitespace
snmp_agent plugin: fix a few build warnings
```
CC src/snmp_agent_la-snmp_agent.lo
src/snmp_agent.c:166:25: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
for (int i = 0; i < dd->oids_len; i++) {
~ ^ ~~~~~~~~~~~~
src/snmp_agent.c:190:23: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
for (int i = 0; i < dd->oids_len; i++) {
~ ^ ~~~~~~~~~~~~
src/snmp_agent.c:289:37: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
for (i = 0; i < key_len && offset < oid->oid_len; i++)
~~~~~~ ^ ~~~~~~~~~~~~
src/snmp_agent.c:355:23: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
for (int i = 0; i < dd->oids_len; i++)
~ ^ ~~~~~~~~~~~~
src/snmp_agent.c:420:23: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
for (int i = 0; i < (*dd)->oids_len; i++)
~ ^ ~~~~~~~~~~~~~~~
src/snmp_agent.c:429:25: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
for (int i = 0; i < (*dd)->oids_len; i++)
~ ^ ~~~~~~~~~~~~~~~
src/snmp_agent.c:440:25: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
for (int i = 0; i < (*dd)->oids_len; i++)
~ ^ ~~~~~~~~~~~~~~~
src/snmp_agent.c:532:20: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
assert(oid_index < values_num);
~~~~~~~~~ ^ ~~~~~~~~~~
/usr/include/assert.h:89:5: note: expanded from macro 'assert'
((expr) \
^~~~
src/snmp_agent.c:584:25: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
for (int i = 0; i < dd->oids_len; i++) {
~ ^ ~~~~~~~~~~~~
src/snmp_agent.c:768:23: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
for (int i = 0; i < dd->oids_len; i++) {
~ ^ ~~~~~~~~~~~~
src/snmp_agent.c:806:25: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
for (int i = 0; i < dd->oids_len; i++) {
~ ^ ~~~~~~~~~~~~
src/snmp_agent.c:821:23: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
for (int i = 0; i < dd->oids_len; i++) {
~ ^ ~~~~~~~~~~~~
src/snmp_agent.c:1287:23: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
for (int i = 0; i < dd->oids_len; i++) {
~ ^ ~~~~~~~~~~~~
13 warnings generated.
```
```
CC src/snmp_agent_la-snmp_agent.lo
src/snmp_agent.c:166:25: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
for (int i = 0; i < dd->oids_len; i++) {
~ ^ ~~~~~~~~~~~~
src/snmp_agent.c:190:23: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
for (int i = 0; i < dd->oids_len; i++) {
~ ^ ~~~~~~~~~~~~
src/snmp_agent.c:289:37: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
for (i = 0; i < key_len && offset < oid->oid_len; i++)
~~~~~~ ^ ~~~~~~~~~~~~
src/snmp_agent.c:355:23: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
for (int i = 0; i < dd->oids_len; i++)
~ ^ ~~~~~~~~~~~~
src/snmp_agent.c:420:23: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
for (int i = 0; i < (*dd)->oids_len; i++)
~ ^ ~~~~~~~~~~~~~~~
src/snmp_agent.c:429:25: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
for (int i = 0; i < (*dd)->oids_len; i++)
~ ^ ~~~~~~~~~~~~~~~
src/snmp_agent.c:440:25: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
for (int i = 0; i < (*dd)->oids_len; i++)
~ ^ ~~~~~~~~~~~~~~~
src/snmp_agent.c:532:20: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
assert(oid_index < values_num);
~~~~~~~~~ ^ ~~~~~~~~~~
/usr/include/assert.h:89:5: note: expanded from macro 'assert'
((expr) \
^~~~
src/snmp_agent.c:584:25: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
for (int i = 0; i < dd->oids_len; i++) {
~ ^ ~~~~~~~~~~~~
src/snmp_agent.c:768:23: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
for (int i = 0; i < dd->oids_len; i++) {
~ ^ ~~~~~~~~~~~~
src/snmp_agent.c:806:25: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
for (int i = 0; i < dd->oids_len; i++) {
~ ^ ~~~~~~~~~~~~
src/snmp_agent.c:821:23: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
for (int i = 0; i < dd->oids_len; i++) {
~ ^ ~~~~~~~~~~~~
src/snmp_agent.c:1287:23: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
for (int i = 0; i < dd->oids_len; i++) {
~ ^ ~~~~~~~~~~~~
13 warnings generated.
```
ipvs plugin: minor cleanup
- Remove some Yoda conditionals
- Give some variables better names
- Use C99 designated initializers in some places.
- Remove some Yoda conditionals
- Give some variables better names
- Use C99 designated initializers in some places.
Merge pull request #2327 from rpv-tomsk/snmp-custom-port
snmp plugin: Option `Address` documented in more details.
snmp plugin: Option `Address` documented in more details.
email plugin: fix Yoda conditionals
Fix mismerge
exec plugin: remove some Yoda conditionals
Merge branch 'collectd-5.7'
Conflicts:
src/openldap.c
Conflicts:
src/openldap.c
Merge branch 'collectd-5.6' into collectd-5.7
email, exec and unixsock plugins: enlarge buffer for getgrnam_r result
Thanks to Jeremie Courreges-Anglas and Daniel Jakots.
Thanks to Jeremie Courreges-Anglas and Daniel Jakots.
email, exec and unixsock plugins: fix error handling
Diff from Jeremie Courreges-Anglas, via Daniel Jakots
Diff from Jeremie Courreges-Anglas, via Daniel Jakots
Merge pull request #2331 from mfournier/ldap_unbind-segfault
openldap: check ld structure before passing it to ldap_unbind()
openldap: check ld structure before passing it to ldap_unbind()
openldap: check ld structure before passing it to ldap_unbind()
This prevents collectd from segfaulting when the ldap session setup
fails before opening a connection to openldap (syntax error in the URL
option for example).
This prevents collectd from segfaulting when the ldap session setup
fails before opening a connection to openldap (syntax error in the URL
option for example).
snmp: Option `Address` documented in more details.
As described at http://net-snmp.sourceforge.net/dev/agent/structsnmp__session.html,
it may include transport specifier and/or port number.
Configuration examples are updated too.
Closes: #2302
As described at http://net-snmp.sourceforge.net/dev/agent/structsnmp__session.html,
it may include transport specifier and/or port number.
Configuration examples are updated too.
Closes: #2302
Merge pull request #2320 from maryamtahhan/feat_snmp_compilation_issue
SNMP Agent: Fix compilation issue of snmp_agent plugin
SNMP Agent: Fix compilation issue of snmp_agent plugin
SNMP Agent: Fix compilation issue on Net-SNMP v5.4.3
The compilation of SNMP Agent fails on older version of
Net-SNMP (5.4.3).
Signed-off-by: Mytnyk, VolodymyrX <volodymyrx.mytnyk@intel.com>
The compilation of SNMP Agent fails on older version of
Net-SNMP (5.4.3).
Signed-off-by: Mytnyk, VolodymyrX <volodymyrx.mytnyk@intel.com>
Add micro-seconds resolution in write_riemann
riemann-c-client 1.10.0 and higher supports micro-seconds time
resolution for Riemann events.
riemann-c-client 1.10.0 and higher supports micro-seconds time
resolution for Riemann events.
intel_pmu: address PR comments
Change-Id: I172ad8535edda429cd58e0d6198aa19af76151eb
Signed-off-by: Serhiy Pshyk <serhiyx.pshyk@intel.com>
Change-Id: I172ad8535edda429cd58e0d6198aa19af76151eb
Signed-off-by: Serhiy Pshyk <serhiyx.pshyk@intel.com>
Bump version to 5.7.2; Update ChangeLog.
Merge branch 'collectd-5.7'
Conflicts:
src/intel_rdt.c
Conflicts:
src/intel_rdt.c
Merge pull request #2310 from octo/ff/intel_rdt
intel_rdt plugin: Remove unnecessary goto.
intel_rdt plugin: Remove unnecessary goto.
intel_rdt plugin: Remove unnecessary goto.
Merge branch 'collectd-5.7'
Merge branch 'collectd-5.6' into collectd-5.7
Bind plugin: plug a few leaks
Fixes: #2303
Fixes: #2303
Merge pull request #2307 from saiarcot895/mongo-mem-leak
Use bson_destroy instead of bson_free, and fix memleak issue.
Use bson_destroy instead of bson_free, and fix memleak issue.
Use bson_destroy instead of bson_free, and fix memleak issue.
intel_pmu: configure.ac code style cleanup
Change-Id: Ie69b921a253f418ac7b87248faa29d9d35c647a0
Signed-off-by: Serhiy Pshyk <serhiyx.pshyk@intel.com>
Change-Id: Ie69b921a253f418ac7b87248faa29d9d35c647a0
Signed-off-by: Serhiy Pshyk <serhiyx.pshyk@intel.com>
Merge pull request #2304 from archii/fix-ipmi-docs-typo
Fix ipmi docs typo
Fix ipmi docs typo
intel_pmu: address PR comments
- cleanup of configure.ac
- add config option EventList to avoid dependency on environment variables
Change-Id: I987095b6e71bcf05103e773793c0a40c815f729b
Signed-off-by: Serhiy Pshyk <serhiyx.pshyk@intel.com>
- cleanup of configure.ac
- add config option EventList to avoid dependency on environment variables
Change-Id: I987095b6e71bcf05103e773793c0a40c815f729b
Signed-off-by: Serhiy Pshyk <serhiyx.pshyk@intel.com>
Merge pull request #1 from archii/archii-fix-docs-typo-1
fix typo in collectd.conf.pod
fix typo in collectd.conf.pod
fix typo in collectd.conf.pod
python plugin: stop disabling strict aliasing
According to https://bugs.python.org/issue1718153, this has been fixed
in python 2.6, the oldest version we support.
According to https://bugs.python.org/issue1718153, this has been fixed
in python 2.6, the oldest version we support.
configure.ac: slightly tweak dpdk check
configure.ac: keep libs sorted
configure.ac: detect compiler vendor
I'll use this in followup patches to detect if the compiler supports
various warning flags. For example, a long standing issue is that older
version of the Sun studio compiler doesn't support -Werror.
I'll use this in followup patches to detect if the compiler supports
various warning flags. For example, a long standing issue is that older
version of the Sun studio compiler doesn't support -Werror.
configure.ac: no need for body for preproc test
configure.ac: use preprocessor to detect libpqos version
No need to run the program.
No need to run the program.
configure.ac: use preprocessor to detect dpdk version
The test doesn't run any code, so no need to compile it.
The test doesn't run any code, so no need to compile it.
configure.ac: replace AS_IF with normal test
AS_IF is slightly more portable, but slightly less readable.
AS_IF is slightly more portable, but slightly less readable.
configure.ac: replace last few tabs with spaces
configure.ac: fix libpqos detection style
snmp-agent: fix build on RHEL6
libnetsnmpagent.so from net-snmp 5.5 needs some symbols from libnetsnmphelpers.so,
but does not link against it on RHEL5.
Work around this by looking for one of those symbols in the helper lib,
and if found, link against it.
Later versions of net-snmp seem to have moved those symbols to
libnetsnmpagent.so, so it's not an issue there.
libnetsnmpagent.so from net-snmp 5.5 needs some symbols from libnetsnmphelpers.so,
but does not link against it on RHEL5.
Work around this by looking for one of those symbols in the helper lib,
and if found, link against it.
Later versions of net-snmp seem to have moved those symbols to
libnetsnmpagent.so, so it's not an issue there.
configure.ac: remove unneeded include
All files in AC_CONFIG_MACRO_DIR are included by default.
All files in AC_CONFIG_MACRO_DIR are included by default.
configure.ac: improve libnetsnmpagent detection
Turn it into a separate check, which also makes it possible to disable
it.
snmp_agent and snmp are separate plugins, and on at least Fedora are
packaged separately.
A beneficial side effect is that this reduces overlinking of snmp.so
with libnetsnmpagent.so
Turn it into a separate check, which also makes it possible to disable
it.
snmp_agent and snmp are separate plugins, and on at least Fedora are
packaged separately.
A beneficial side effect is that this reduces overlinking of snmp.so
with libnetsnmpagent.so
snmp-agent: check for the right header
We never include net-snmp/agent/agent_module_config.h
We never include net-snmp/agent/agent_module_config.h
configure.ac: fix style for snmpagent plugin
configure.ac: fix overquoting