curl_json: fix the array access implemented in f1e1e37e
In the avl-tree we store two different structs, cj_key_t for the value
we search, c_avl_tree_t for sub-nodes.
The old version does assume when it will find a key, and when a tree,
which doesn't have to be right in all cases.
Therefore we utilize the magic to revalidate this cast.
Being able to tell tree from key, we now can also implement array access
on the right most node of the tree-path.
In the avl-tree we store two different structs, cj_key_t for the value
we search, c_avl_tree_t for sub-nodes.
The old version does assume when it will find a key, and when a tree,
which doesn't have to be right in all cases.
Therefore we utilize the magic to revalidate this cast.
Being able to tell tree from key, we now can also implement array access
on the right most node of the tree-path.
Merge pull request #778 from landryb/openbsd_fix_processes_plugin
Fix the processes plugin on OpenBSD (#776)
Fix the processes plugin on OpenBSD (#776)
Merge pull request #779 from landryb/openbsd_build_fixes
Openbsd build fixes
Openbsd build fixes
varnish: add some detail & references to manpage
varnish: manpage & example cleanup
Consitently alphabetically ordered options and ensured all version
limitations are mentioned.
Consitently alphabetically ordered options and ensured all version
limitations are mentioned.
varnish: correct an erroneous type
Affects Varnish 3 only.
Affects Varnish 3 only.
varnish: monitor VSM usage stats, made available in V4
varnish: monitor 2 purge-relatad metrics added in V4
varnish: add a couple of metrics available both in V3 & V4
varnish: adapt to metrics renames & deprecations in varnish4
Summary of changes:
- connections: "accepted" & "dropped" are now found in the session section
- dirdns: doesn't exist in varnish 4 anymore
- objects: "n_obj*" were removed from varnish 4
- ban: "obj", "req" & "completed" bans were added. As a lot of new
"tested" metrics are available, so we only collectd the overall total
now
- session: metrics from "connections" and "threads" categories were
moved here
- struct: "n_sess*" were removed
- totals: new, more detailed *bytes metrics were made available
- threads: new metrics were made available. "queued" was moved the
session section.
Summary of changes:
- connections: "accepted" & "dropped" are now found in the session section
- dirdns: doesn't exist in varnish 4 anymore
- objects: "n_obj*" were removed from varnish 4
- ban: "obj", "req" & "completed" bans were added. As a lot of new
"tested" metrics are available, so we only collectd the overall total
now
- session: metrics from "connections" and "threads" categories were
moved here
- struct: "n_sess*" were removed
- totals: new, more detailed *bytes metrics were made available
- threads: new metrics were made available. "queued" was moved the
session section.
varnish: bare minimum changes to support varnish4
configure: add varnish4 presence detection
Recent NetBSD versions also use a TAILQ.
Use cpu_stage() where expected in the CAN_USE_SYSCTL, HAVE_LIBSTATGRAB and HAVE_SYSCTLBYNAME codepaths.
cpu_state() isnt a function.
cpu_state() isnt a function.
inpt_queue is a TAILQ on OpenBSD
Link collectd-tg with -lpthread if available
otherwise linking fails with undefined refs to pthread_mutex_* functions
otherwise linking fails with undefined refs to pthread_mutex_* functions
Fix swapctl() argument count detection on OpenBSD.
on OpenBSD swapctl() takes three arguments, but is defined in unistd.h
and also needs sys/param.h.
http://www.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man2/swapctl.2
we need to add those headers to both detections to make sure the test
on 'swapctl takes two arguments' correctly fails.
on OpenBSD swapctl() takes three arguments, but is defined in unistd.h
and also needs sys/param.h.
http://www.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man2/swapctl.2
we need to add those headers to both detections to make sure the test
on 'swapctl takes two arguments' correctly fails.
Include pthread.h in plugin.h to get pthread_t definition.
Fix the processes plugin on OpenBSD (#776)
Properly check for struct kinfo_proc members in configure.ac
Use kvm_getprocs() like it was done on FreeBSD
Properly check for struct kinfo_proc members in configure.ac
Use kvm_getprocs() like it was done on FreeBSD
Merge remote-tracking branch 'origin/pr/488'
Let the config parser accept unquoted IPv6 addresses.
The parser supports raw IPv6 addresses, optional address and port (as
[<addr>]:<port>), and embedded IPv4 addresses.
Based on "Common Patterns" found in the flex manual.
The parser supports raw IPv6 addresses, optional address and port (as
[<addr>]:<port>), and embedded IPv4 addresses.
Based on "Common Patterns" found in the flex manual.
Merge pull request #774 from trenkel/master
Adding get_dataset() to python
Adding get_dataset() to python
python: Add get_dataset() to the man page.
Add get_dataset() as a way to get the definition of a dataset from python.
https://github.com/collectd/collectd/issues/771
https://github.com/collectd/collectd/issues/771
Including vl->type, even when vl->type_instance is available to avoid over-writing values (i.e. with the 'df' plugin)
mysql: correct 2 data types in innodb counters
Thanks to @ekilby for spotting this mistake ! Fixes #757
Thanks to @ekilby for spotting this mistake ! Fixes #757
Use the complain mechanism to report write failures.
This ensures that we don't spam the log for each submitted value. Instead, an
exponential backup is used to report permanent errors starting at one message
per second.
This ensures that we don't spam the log for each submitted value. Instead, an
exponential backup is used to report permanent errors starting at one message
per second.
write_graphite plugin: Improved error reporting when connecting to the server.
missed the output_name
Added support for the last two additional columns in add-linux-io-time
Merge pull request #751 from ptbrowne/prepend-sys-path
feat(python-plugin): prepend instead of append ModulePath to sys.path
feat(python-plugin): prepend instead of append ModulePath to sys.path
doc(collectd-python): update
feat(python-plugin): prepend instead of append ModulePath to sys.path
When importing a module, you expect the plugin repertory to have higher priority
than your site-packages. It will prevent hard to debug clashing module names problems.
At least, if there is a problem, it will fail more loudly than "module did not register
any config callback"
When importing a module, you expect the plugin repertory to have higher priority
than your site-packages. It will prevent hard to debug clashing module names problems.
At least, if there is a problem, it will fail more loudly than "module did not register
any config callback"
cpu plugin: Don't report empty cpu states.
statsd: clarify/simplify documentation & example
src/Makefile.am: Make sure plugins only export "module_register".
While there, put the LDFLAGS shared between all plugins into a separate
variable.
While there, put the LDFLAGS shared between all plugins into a separate
variable.
Merge remote-tracking branch 'github/pr/697'
Merge remote-tracking branch 'github/pr/734'
Added documentation for StatsD module per added functionality in issue #403.
bind plugin: split bind_xml_stats to v3 and v1_v2.
And minor change to bind_parse_generic_name_attr_value_list.
And minor change to bind_parse_generic_name_attr_value_list.
Bit shift right by 8 to get return code from exit status
Pull-Request: #741
Signed-off-by: Florian Forster <octo@collectd.org>
Pull-Request: #741
Signed-off-by: Florian Forster <octo@collectd.org>
bind plugin: add support for the new XML v3 API.
Unfortunately, this new API does not provide per-zone data
any more, thus 'Zone' options like
Zone "example.com/IN"
are ignored if API version is 3.
Unfortunately, this new API does not provide per-zone data
any more, thus 'Zone' options like
Zone "example.com/IN"
are ignored if API version is 3.
COPYING: Add the MIT License and add a note about plugins being licensed individually.
Move utils_parse_option.[ch] out of the daemon/ directory.
common.[ch]: Move escape_string() to here.
Move collectd daemon files to the src/daemon/ directory.
memory: make linux slab reporting work with older kernels
memory: adjust safeguard to changes from previous commit
src/collectd.c: Set the LC_NUMERIC locale to "C".
When using ASCII protocols, such as the Graphite protocol, doubles are
converted to strings using sprintf(3) and parsed with strtod(3). If the
effective locale uses something different from a dot (".") as the
decimal separator (e.g. Portuguese, German), this breaks.
This patch sets the LC_NUMERIC locale to "C" on start-up, so that
strings are produced and parsed in a well-defined manner.
Fixes: #512
When using ASCII protocols, such as the Graphite protocol, doubles are
converted to strings using sprintf(3) and parsed with strtod(3). If the
effective locale uses something different from a dot (".") as the
decimal separator (e.g. Portuguese, German), this breaks.
This patch sets the LC_NUMERIC locale to "C" on start-up, so that
strings are produced and parsed in a well-defined manner.
Fixes: #512
cpu plugin: Remove temperature code for Mac OS X.
This code would throw an error for some systems, because the temperature
couldn't be read. Since the plugin still works in general, this was very
confusing to users. Becaus the temperature, even when read sucessfully, was
never dispatched, remove the code entirely. We might want to add this back to
the apple_sensors plugin eventually.
Fixes: #22
This code would throw an error for some systems, because the temperature
couldn't be read. Since the plugin still works in general, this was very
confusing to users. Becaus the temperature, even when read sucessfully, was
never dispatched, remove the code entirely. We might want to add this back to
the apple_sensors plugin eventually.
Fixes: #22
swap plugin: Make "cached" optional under Linux.
This is the smallest possible fix for OpenVZ, where cached is not available.
master has a more complete fix which should be used going forward.
Fixes: #733
This is the smallest possible fix for OpenVZ, where cached is not available.
master has a more complete fix which should be used going forward.
Fixes: #733
write_graphite plugin: Limit number of reconnection attempts per time.
Fixes: #625
Fixes: #625
memory plugin: Add slab memory stats (linux)
Pull-Request: #560
Pull-Request: #560
virt plugin: Rename the "libvirt" plugin to "virt".
"libvirt" confused libtool and caused problems when re-building from source.
"libvirt" confused libtool and caused problems when re-building from source.
cpu plugin: Various, random fixes and improvements:
* Add Pierre-Yves to the list of copyright holders.
* Make sure the entire file is consistently indented.
* Renamed the "ReportActive" config option to "ReportByState"
(with negated logic).
* Renamed internal functions to better reflect their use.
* Let cpu_stage() (née submit()) work on individual counters / derives
rather than an array, removing logic from the cpu_read() function.
* Rename CPU_SUBMIT_* to CPU_STATE_*.
* Move legacy behavior it its own function, cpu_commit_without_aggregation().
* Add Pierre-Yves to the list of copyright holders.
* Make sure the entire file is consistently indented.
* Renamed the "ReportActive" config option to "ReportByState"
(with negated logic).
* Renamed internal functions to better reflect their use.
* Let cpu_stage() (née submit()) work on individual counters / derives
rather than an array, removing logic from the cpu_read() function.
* Rename CPU_SUBMIT_* to CPU_STATE_*.
* Move legacy behavior it its own function, cpu_commit_without_aggregation().
swap plugin: Make SwapCached optional under Linux.
OpenVZ doesn't provide the line, which caused swap collection to be
skipped entirely on these systems. Instead, "cached" should simply be
ignored, as it is on other systems. Thanks to @zerkms for reporting this
problem!
Fixes: #733
OpenVZ doesn't provide the line, which caused swap collection to be
skipped entirely on these systems. Instead, "cached" should simply be
ignored, as it is on other systems. Thanks to @zerkms for reporting this
problem!
Fixes: #733
cpu plugin: Fix parsing of SoftIRQ under Linux.
openvpn plugin: Don't signal an error when no clients are connected.
In the multi1_read() function, an error (zero) was returned when no
clients were currently connected to the OpenVPN server, because the
"read" variable was initialized to zero and the while loop exited before
it was set to one. This is not the intended behavior.
Thanks to @srix for reporting this issue!
Fixes: #731
In the multi1_read() function, an error (zero) was returned when no
clients were currently connected to the OpenVPN server, because the
"read" variable was initialized to zero and the while loop exited before
it was set to one. This is not the intended behavior.
Thanks to @srix for reporting this issue!
Fixes: #731
Add ReconnectInterval option to Network plugin
The Network plugin only performs DNS resolution at initialization. This
can be problematic when trying to performs migrations of collectd
infrastructure or when trying to create HA solutions which are dependant
on DNS.
The ReconnectInterval options forces a reconnect of all the sockets at
the defined number of seconds. By default no re-connections are attempted
if this option is not set.
The Network plugin only performs DNS resolution at initialization. This
can be problematic when trying to performs migrations of collectd
infrastructure or when trying to create HA solutions which are dependant
on DNS.
The ReconnectInterval options forces a reconnect of all the sockets at
the defined number of seconds. By default no re-connections are attempted
if this option is not set.
Move sockent_client_disconnect above sockent_client_disconnect so we can use it there
collectd.conf(5): Document the ReportDegraded" option.
battery plugin: Implement the "ReportDegraded" option.
battery plugin: Implement the ValuesPercentage option.
battery plugin: Only report "current" when actually supplied by the battery.
I think the commend in the file sums it up pretty good, read that ;)
I think the commend in the file sums it up pretty good, read that ;)
AUTHORS: Add Andy Parkins.
Fix typo in if caluse
Fixes #729
Signed-off-by: Florian Forster <octo@collectd.org>
Fixes #729
Signed-off-by: Florian Forster <octo@collectd.org>
Fix typo in if caluse
Fixes #729
Fixes #729
add listval_filter method and corresponding tests
Rationale:
A frequent use case for LISTVAL is to retrieve a list of resources for a certain
host or host group that is not known in advance, such as when the hosts have
different disks installed. Using the existing listval() method,
Collectd::Unixsock retrieves the entire list, parses each entry into a hash and
returns the list, only to have the caller throw away the vast majority of
entries immediately. listval_filter() allows the caller to pass any attribute
that can be passed to getval() and filters the list of resources retrieved from
the socket before parsing it, resulting in a large speedup.
The current implemntation has some code duplication, although listval() could be
implemented as a small wrapper around listval_filter() with just a few percent
speed penalty due to the extra dynamically built regexp.
Rationale:
A frequent use case for LISTVAL is to retrieve a list of resources for a certain
host or host group that is not known in advance, such as when the hosts have
different disks installed. Using the existing listval() method,
Collectd::Unixsock retrieves the entire list, parses each entry into a hash and
returns the list, only to have the caller throw away the vast majority of
entries immediately. listval_filter() allows the caller to pass any attribute
that can be passed to getval() and filters the list of resources retrieved from
the socket before parsing it, resulting in a large speedup.
The current implemntation has some code duplication, although listval() could be
implemented as a small wrapper around listval_filter() with just a few percent
speed penalty due to the extra dynamically built regexp.
refactor common query-response code
clean up Perl style a bit
- Remove some superfluous parenthesis clutter
- Shorten a lot of single-line conditionals using postfix constructions
- Merge variable declarations
- Use $class/$self instead of $pkg/$obj as is customary
- Remove quotes around literal hash keys
- Remove some superfluous parenthesis clutter
- Shorten a lot of single-line conditionals using postfix constructions
- Merge variable declarations
- Use $class/$self instead of $pkg/$obj as is customary
- Remove quotes around literal hash keys
replace Regexp::Common with core Scalar::Util
add a test suite
Merge branch 'collectd-5.3' into collectd-5.4
battery plugin: Import code to read metrics from sysfs.
This started as a simple import of Andy Parkins' sysfsbattery plugin into
the battery plugin. Since the battery plugin is ancient and hasn't been
touched in a while, this quickly escalated to a much bigger refactoring.
Sorry!
On the other hand, this fixes a couple of bugs. For example, all metrics
were always dispatched with plugin_instance "0". This is correct for the
majority of laptops, of course, but in theory this could be wrong.
Also ACPI charging / discharging rate is reported as "current", when
modern batteries actually report "power". The sysfs code does this
correctly, ACPI still needs to be patched.
Fixes: #725
This started as a simple import of Andy Parkins' sysfsbattery plugin into
the battery plugin. Since the battery plugin is ancient and hasn't been
touched in a while, this quickly escalated to a much bigger refactoring.
Sorry!
On the other hand, this fixes a couple of bugs. For example, all metrics
were always dispatched with plugin_instance "0". This is correct for the
majority of laptops, of course, but in theory this could be wrong.
Also ACPI charging / discharging rate is reported as "current", when
modern batteries actually report "power". The sysfs code does this
correctly, ACPI still needs to be patched.
Fixes: #725
src/common.[ch]: Implement strtogauge().
src/common.c: Fix strstripnewline().
Because the length of the string was decremented too late, the function
would actually overwrite the trailing null byte instead of the newline.
Because the length of the string was decremented too late, the function
would actually overwrite the trailing null byte instead of the newline.
src/configfile.c: Fix the default interval setting.
Also fixes a bug in global_option_get_time(): Values smaller than or
equal to zero are illegal and the default value should be returned.
Thanks to @anandkarthik for spotting this!
Fixes: #727
Also fixes a bug in global_option_get_time(): Values smaller than or
equal to zero are illegal and the default value should be returned.
Thanks to @anandkarthik for spotting this!
Fixes: #727
RPM specfile: take all new plugins and dependencies in account
Merge branch 'collectd-5.4'
RPM specfile: enable lvm plugin on RHEL7
Merge branch 'collectd-5.3' into collectd-5.4
Conflicts:
contrib/redhat/collectd.spec
Conflicts:
contrib/redhat/collectd.spec
Merge remote-tracking branch 'github/master'
processes plugin: Limit the buffer size used for command line matching.
ARG_MAX is quite big on many systems, for example >100 kByte on
GNU/Linux. This is a problem for systems with tight memory constraints,
for example embedded devices.
This patch uses at most 4 kByte for this, which out to be enough for the
vast majority of users. Users with specific requirements can compile
with "CMDLINE_BUFFER_SIZE=${LOTS}" in their CPPFLAGS to override this
default.
Fixes: #652
ARG_MAX is quite big on many systems, for example >100 kByte on
GNU/Linux. This is a problem for systems with tight memory constraints,
for example embedded devices.
This patch uses at most 4 kByte for this, which out to be enough for the
vast majority of users. Users with specific requirements can compile
with "CMDLINE_BUFFER_SIZE=${LOTS}" in their CPPFLAGS to override this
default.
Fixes: #652
RPM specfile: enable netlink plugin on RHEL > 5
RPM specfile: fix bogus dates
modern rpmbuild versions appear to be more strict on this point.
modern rpmbuild versions appear to be more strict on this point.
RPM specfile: support for RHEL7
RPM specfile: remove define accidentally re-added when handling merge conflict
RPM specfile: remove macro accidentally re-added when handling merge conflict
RPM specfile: remove duplicate modbus block
improve CollectInternalStats's documentation
Merge remote-tracking branch 'origin/pr/691'
Merge branch 'pr-713'
src/plugin.c: Parse "MaxReadInterval" with global_option_get_time().
src/configfile.[ch]: Implement global_option_get_time().
src/configfile.c: Use cf_util_get_cdtime() to parse the "Interval" settings.
set target: Simplify config parsing.
disk plugin: Add metric for pending I/O operations.
This is only supported on Linux right now.
Fixes: #705
This is only supported on Linux right now.
Fixes: #705
Merge branch 'collectd-5.4'