openvpn: Changes after review, clang-formatting
openvpn: reworked status file parser
* Added detection of status fields index by parsing 'HEADER' lines.
This allows to support status files from latest OpenVPN-2.4 and possible from future versions;
* Fixed a bug with OpenVPN status file version 3 where delimiter is 'tab' (not space or comma);
* Status file version detection was moved from configuration callback to read callback;
* Now 'plugin_register_complex_read()' is used for registering read callback.
Closes: #2128
* Added detection of status fields index by parsing 'HEADER' lines.
This allows to support status files from latest OpenVPN-2.4 and possible from future versions;
* Fixed a bug with OpenVPN status file version 3 where delimiter is 'tab' (not space or comma);
* Status file version detection was moved from configuration callback to read callback;
* Now 'plugin_register_complex_read()' is used for registering read callback.
Closes: #2128
nfs plugin: Fix typo
Merge remote-tracking branch 'github/pr/2430'
Merge branch 'pr/2431'
uptime plugin: Coding style update.
This is only touching the Linux code, though.
This is only touching the Linux code, though.
nfs plugin: Changes after review
* Avoid negated config options (s/IgnoreV/ReportV/)
* Use _Bool instead of int
* Handle multiple occurences of config option correctly
* Avoid negated config options (s/IgnoreV/ReportV/)
* Use _Bool instead of int
* Handle multiple occurences of config option correctly
Merge branch 'collectd-5.7'
Reimplemented `uptime` plugin to read from `/proc/uptime`
synproxy plugin: Re-run clang-format.
Merge remote-tracking branch 'github/pr/2381'
Merge pull request #2417 from bluca/dpdk_pkgconfig_backport
configure.ac: dpdk: use pkg-config - 5.7
configure.ac: dpdk: use pkg-config - 5.7
Merge remote-tracking branch 'github/pr/2412'
use generic types in synproxy plugin and code refactoring
Fix source path in automake
New plugin: synproxy
nfs: Add config options to ignore versions
Merge remote-tracking branch 'github/pr/2258'
Treewide: Don't set value_list_t.host to hostname_g.
plugin_dispatch_values() will automatically fill that value in.
plugin_dispatch_values() will automatically fill that value in.
libcollectdclient: Guard gcrypt code with preprocessor conditionals.
libcollectdclient: Include <stdlib.h> and <string.h>.
For free(3) and memmove(3) respectively.
For free(3) and memmove(3) respectively.
collectd.spec: add new intel_pmu plugin
configure.ac: fix indentation
Merge pull request #2405 from cpaelzer/fix-dpdk-pkg-config-if-not-available
configure.ac: dpdk: tolerate no pkg-config
configure.ac: dpdk: tolerate no pkg-config
configure.ac: follow the 2 space indent style
The rest of configure.ac indents not to the context, but by 2 spaces.
Follow that rule to stay in style.
Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
The rest of configure.ac indents not to the context, but by 2 spaces.
Follow that rule to stay in style.
Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
configure.ac: fix indent
Fix tab indents to be space based as they should, but keep the
effective indent at the level of the context it belongs to in
PKG_CHECK_MODULES.
Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Fix tab indents to be space based as they should, but keep the
effective indent at the level of the context it belongs to in
PKG_CHECK_MODULES.
Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
configure.ac: dpdk: use pkg-config
To detect cflags and libs use the sometimes provided pkg-config for
libdpdk. That avoids build errors on systems where special flags are
needed and provided by dpdk via pkg-config, but not yet considered by
the collectd build system.
To detect cflags and libs use the sometimes provided pkg-config for
libdpdk. That avoids build errors on systems where special flags are
needed and provided by dpdk via pkg-config, but not yet considered by
the collectd build system.
configure.ac: dpdk: tolerate no pkg-config
Since pull request #2400 pkg-config works great for dpdk, but not if
there is no pkg-config around at all.
To fix that the PKG_CHECK_MODULES macro needs to define a valid fourth
argument, otherwise it will error out.
This closes 2404
Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Since pull request #2400 pkg-config works great for dpdk, but not if
there is no pkg-config around at all.
To fix that the PKG_CHECK_MODULES macro needs to define a valid fourth
argument, otherwise it will error out.
This closes 2404
Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Merge pull request #2400 from cpaelzer/fix-dpdk-multiarch-pkg-config
configure.ac: dpdk: use pkg-config
configure.ac: dpdk: use pkg-config
configure.ac: dpdk: append DPDK_CFLAGS to LIBDPDK_CPPFLAGS
In some way it is bad naming in pkg-config - it is always some sort of
conflated ldflags + libs and cppflags + cxxflags + cflags.
Due to that to work correctly we append DPDK_CFLAGS (if defined by
pkg-config) to LIBDPDK_CPPFLAGS as well.
This intentionally does not add those CFLAGS specified by a user to
allow full override and fully separated CLFAGS/CPPFLAGS if needed.
Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
In some way it is bad naming in pkg-config - it is always some sort of
conflated ldflags + libs and cppflags + cxxflags + cflags.
Due to that to work correctly we append DPDK_CFLAGS (if defined by
pkg-config) to LIBDPDK_CPPFLAGS as well.
This intentionally does not add those CFLAGS specified by a user to
allow full override and fully separated CLFAGS/CPPFLAGS if needed.
Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
configure.ac: dpdk: introduce LIBDPDK_CFLAGS
This restores the former behavior of LIBDPDK_CPPFLAGS and now
correctly carries CFLAGS read from pkg-config in its own variable.
Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
This restores the former behavior of LIBDPDK_CPPFLAGS and now
correctly carries CFLAGS read from pkg-config in its own variable.
Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
configure.ac: dpdk: use pkg-config
To detect cflags and libs use the sometimes provided pkg-config for
libdpdk. That avoids build errors on systems where special flags are
needed and provided by dpdk via pkg-config, but not yet considered by
the collectd build system.
This closes #2399
Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
To detect cflags and libs use the sometimes provided pkg-config for
libdpdk. That avoids build errors on systems where special flags are
needed and provided by dpdk via pkg-config, but not yet considered by
the collectd build system.
This closes #2399
Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Merge pull request #2378 from cramertj/grpc-meta
Add metadata support to GRPC plugin
Add metadata support to GRPC plugin
Merge pull request #2380 from maryamtahhan/feat_mcelog_bugfixes
mcelog: fix compilation error caused by migration to snprintf().
mcelog: fix compilation error caused by migration to snprintf().
GRPC metadata review cleanup
mcelog: fix compilation error caused by migration to snprintf().
Change-Id: I625254fa60efbb94580ed2eb69d7c7bf7027a6eb
Signed-off-by: Korynkevych, RomanX <romanx.korynkevych@intel.com>
Change-Id: I625254fa60efbb94580ed2eb69d7c7bf7027a6eb
Signed-off-by: Korynkevych, RomanX <romanx.korynkevych@intel.com>
Add metadata support to GRPC plugin
Merge pull request #2246 from maryamtahhan/feat_mcelog_notification_bugfixes
Feat mcelog notification bugfixes
Feat mcelog notification bugfixes
mcelog: updates based on review comments
* modified code to use return without parenthesis
* fixed logic that parses config options
Change-Id: I2c5c5f42f8395306622dee8cdf4f94b46e3e3570
Signed-off-by: Korynkevych, RomanX <romanx.korynkevych@intel.com>
* modified code to use return without parenthesis
* fixed logic that parses config options
Change-Id: I2c5c5f42f8395306622dee8cdf4f94b46e3e3570
Signed-off-by: Korynkevych, RomanX <romanx.korynkevych@intel.com>
Merge pull request #2349 from rpv-tomsk/fix-register-complex-read
Free `userdata` if plugin_register_complex_read() has failed.
Free `userdata` if plugin_register_complex_read() has failed.
openldap: Fixed possible dereference of NULL pointer
If `plugin_register_complex_read()` has failed, then `cldap_free` is called which set pointer to NULL.
That pointer is accessed by `cldap_shutdown()` callback later.
If `plugin_register_complex_read()` has failed, then `cldap_free` is called which set pointer to NULL.
That pointer is accessed by `cldap_shutdown()` callback later.
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 pull request #2374 from maryamtahhan/feat_intel_pmu_bugfixes
intel_pmu: fix compilation error caused by migration to snprintf().
intel_pmu: fix compilation error caused by migration to snprintf().
intel_pmu: fix compilation error caused by migration to snprintf().
Change-Id: I4e461cd11aa03ca588649ca86892c23c9f38fc54
Signed-off-by: Korynkevych, RomanX <romanx.korynkevych@intel.com>
Change-Id: I4e461cd11aa03ca588649ca86892c23c9f38fc54
Signed-off-by: Korynkevych, RomanX <romanx.korynkevych@intel.com>
Merge branch 'collectd-5.7'
Conflicts:
src/rrdtool.c
Conflicts:
src/rrdtool.c
Merge branch 'collectd-5.6' into collectd-5.7
Conflicts:
src/rrdtool.c
Conflicts:
src/rrdtool.c
Merge pull request #2232 from rpv-tomsk/processes
processes: Show real disk IO in addition to process IO (Linux only)
processes: Show real disk IO in addition to process IO (Linux only)
rrdtool plugin: Changes after review
* Handle "CacheFlush" as a double
* Updated documentation spelling
* Handle "CacheFlush" as a double
* Updated documentation spelling
rrdtool plugin: Respect RandomTimeout while calling CacheFlush handler
The CacheFlush implementation does not respect RandomTimeout value.
All cache values, whose flush is deferred by RandomTimeout variance,
will be flushed. That can cause a partial or full cache flush,
depending on the value of RandomTimeout.
The CacheFlush implementation does not respect RandomTimeout value.
All cache values, whose flush is deferred by RandomTimeout variance,
will be flushed. That can cause a partial or full cache flush,
depending on the value of RandomTimeout.
rrdtool plugin: Configuration check moved to init callback
The "RandomTimeout" option value check moved from rrd_get_random_variation()
to rrd_init(). This will save few CPU cycles.
The "RandomTimeout" option value check moved from rrd_get_random_variation()
to rrd_init(). This will save few CPU cycles.
rrdtool plugin: Remove excessive complain
The plugin complains `Adjusting "RandomTimeout" to 0.000 seconds.` even
if no 'CacheTimeout' was set.
The plugin complains `Adjusting "RandomTimeout" to 0.000 seconds.` even
if no 'CacheTimeout' was set.
rrdtool plugin: Raise interval of random_variation to match documentation
Documentation states what the actual timeout for each value is chosen randomly
between <CacheTimeout>-<RandomTimeout> and <CacheTimeout>+<RandomTimeout>.
The implementation did not match this.
Documentation states what the actual timeout for each value is chosen randomly
between <CacheTimeout>-<RandomTimeout> and <CacheTimeout>+<RandomTimeout>.
The implementation did not match this.
rrdtool plugin: Fix flushing
* Value from wrong option was passed to rrd_cache_flush()
* Variable cache_flush_timeout was used as cdtime_t type time while value was set as simple seconds
* Added info message about CacheFlush ajusting
* Documentation updated
* Value from wrong option was passed to rrd_cache_flush()
* Variable cache_flush_timeout was used as cdtime_t type time while value was set as simple seconds
* Added info message about CacheFlush ajusting
* Documentation updated
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 branch 'master' into feat_mcelog_notification_bugfixes
mcelog: updates based on github review
* Reduces complex level of indentation in conditional blocks
* Uses #defines for corrected and uncorrected strings for notifications
* Fixes memory leaks
* clang was run on the mcelog.c
Change-Id: Ia4c08debc129e2fc9327922299a68304b101d09f
Signed-off-by: Tahhan, Maryam <maryam.tahhan@intel.com>
* Reduces complex level of indentation in conditional blocks
* Uses #defines for corrected and uncorrected strings for notifications
* Fixes memory leaks
* clang was run on the mcelog.c
Change-Id: Ia4c08debc129e2fc9327922299a68304b101d09f
Signed-off-by: Tahhan, Maryam <maryam.tahhan@intel.com>
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>
mcelog: set n.meta to NULL after meta data is cleared.
mcelog plugin got stuck after corrected and uncorrected memory errors injection.
This is caused due to pointing n.meta to unknown place in memory as n.meta
was not set to NULL after meta data has been cleared.
Change-Id: I81bdbeb43a9858f0071e1798e4d7a15423832a35
Signed-off-by: Korynkevych, RomanX <romanx.korynkevych@intel.com>
mcelog plugin got stuck after corrected and uncorrected memory errors injection.
This is caused due to pointing n.meta to unknown place in memory as n.meta
was not set to NULL after meta data has been cleared.
Change-Id: I81bdbeb43a9858f0071e1798e4d7a15423832a35
Signed-off-by: Korynkevych, RomanX <romanx.korynkevych@intel.com>
mcelog: make options mutually exclusive
Make the logfile and socket options mutually exclusive as the collection
requirements for the 2 are different and the memory errors from the
socket overlap with the logfile. Set the default to memory errors until
the logfile changes are merged.
Change-Id: If1eef9d37f1ffe404cf679df4dca9ae3c92ab9ea
Signed-off-by: Tahhan, Maryam <maryam.tahhan@intel.com>
Make the logfile and socket options mutually exclusive as the collection
requirements for the 2 are different and the memory errors from the
socket overlap with the logfile. Set the default to memory errors until
the logfile changes are merged.
Change-Id: If1eef9d37f1ffe404cf679df4dca9ae3c92ab9ea
Signed-off-by: Tahhan, Maryam <maryam.tahhan@intel.com>
mcelog: notification persist option
Implement notification persist option and separate out memory block from the
rest of the configuration.
Change-Id: I48d946bb381d3cfc61fee91a31f3865802389eef
Signed-off-by: Tahhan, Maryam <maryam.tahhan@intel.com>
Implement notification persist option and separate out memory block from the
rest of the configuration.
Change-Id: I48d946bb381d3cfc61fee91a31f3865802389eef
Signed-off-by: Tahhan, Maryam <maryam.tahhan@intel.com>
mcelog: code review fix
Get rid of verbose mcelog_get_dimm() function and use llist_search() instead.
Change-Id: Iccc5c083cf254b82c74f6f77df4a0659ba14282c
Signed-off-by: Tahhan, Maryam <maryam.tahhan@intel.com>
Get rid of verbose mcelog_get_dimm() function and use llist_search() instead.
Change-Id: Iccc5c083cf254b82c74f6f77df4a0659ba14282c
Signed-off-by: Tahhan, Maryam <maryam.tahhan@intel.com>
processes: Show real disk IO in addition to process IO (Linux only)
Before this patch, Collectd reports /proc/PID/io fields 'io_rchar/io_wchar' as
'ps_disk_octets' type and 'io_syscr/io_syscw' as 'ps_disk_ops' type.
The names of these types do not match values they represent.
New, correct mapping implemented:
io_rchar/io_wchar -> io_octets (was ps_disk_octets, not used anymore)
io_syscr/io_syscw -> io_ops (was ps_disk_ops, not used anymore)
read_bytes/write_bytes -> disk_octets (new data collected)
Closes: #1990
Before this patch, Collectd reports /proc/PID/io fields 'io_rchar/io_wchar' as
'ps_disk_octets' type and 'io_syscr/io_syscw' as 'ps_disk_ops' type.
The names of these types do not match values they represent.
New, correct mapping implemented:
io_rchar/io_wchar -> io_octets (was ps_disk_octets, not used anymore)
io_syscr/io_syscw -> io_ops (was ps_disk_ops, not used anymore)
read_bytes/write_bytes -> disk_octets (new data collected)
Closes: #1990
libcollectdclient: Include "config.h" unconditionally.
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