perl plugin: Added basic multi-threading support.
This patch maps each C thread, which accesses the perl plugin, to an
interpreter based Perl thread. The implementation has been inspired by Perl's
ithreads introduced in version 5.6.0 and should be compatible (as in: can be
used side-by-side) with it. You can use threads::shared to share data
structures between threads of either implementation.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
This patch maps each C thread, which accesses the perl plugin, to an
interpreter based Perl thread. The implementation has been inspired by Perl's
ithreads introduced in version 5.6.0 and should be compatible (as in: can be
used side-by-side) with it. You can use threads::shared to share data
structures between threads of either implementation.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
perl plugin: Use PERL_NO_GET_CONTEXT.
All Perl_* API functions have been replaced with their unprefixed
counterparts. The currently used Perl interpreter is passed along to each
function requiring access to it. This removes the need to access the global
variable keeping the pointer to the Perl interpreter in most cases but the
entry points into the plugin (i.e. the callbacks registered with collectd).
This prepares the plugin to efficiently support multiple interpreters.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
All Perl_* API functions have been replaced with their unprefixed
counterparts. The currently used Perl interpreter is passed along to each
function requiring access to it. This removes the need to access the global
variable keeping the pointer to the Perl interpreter in most cases but the
entry points into the plugin (i.e. the callbacks registered with collectd).
This prepares the plugin to efficiently support multiple interpreters.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
configure, perl plugin: Check for ithreads support.
Disable the perl plugin if Perl does not support ithreads (introduced in Perl
5.6). The configure script will check, if USE_ITHREADS has been defined. Also,
the perl plugin won't build if it has not been defined.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Disable the perl plugin if Perl does not support ithreads (introduced in Perl
5.6). The configure script will check, if USE_ITHREADS has been defined. Also,
the perl plugin won't build if it has not been defined.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Merge branch 'ff/fqdn'
collectd: The new `FQDNLookup' option controls whether or not the FQDN should be used.
So far the hostname as returned by `gethostname(2)' was used. This is not
practical for large setups.
To stay backwards compatible the option is disabled by default, but the sample
config file includes a line which sets this option so that (new) default
installations will have it enabled.
So far the hostname as returned by `gethostname(2)' was used. This is not
practical for large setups.
To stay backwards compatible the option is disabled by default, but the sample
config file includes a line which sets this option so that (new) default
installations will have it enabled.
csv plugin: Add the possibility to store rates of counter DSes.
collectd.conf(5): Renamed the `libvirtstats' plugin to `libvirt'.
Also formatting and formulations have been changed a little.
Also formatting and formulations have been changed a little.
libvirt plugin: Renamed the `libvirtstats' plugin to `libvirt'.
Merge branch 'collectd-4.2'
Conflicts:
src/types.db
Conflicts:
src/types.db
Bumped version to 4.2.1; Updated ChangeLog.
Merge branch 'collectd-4.1' into collectd-4.2
Conflicts:
ChangeLog
contrib/PerlLib/Collectd.pm
version-gen.sh
Conflicts:
ChangeLog
contrib/PerlLib/Collectd.pm
version-gen.sh
Bumped version to 4.1.4; Updated ChangeLog
configure.in: Improved the detection of libxml2 and libvirt.
libvirtstats plugin: Fix typos and other mistakes.
I didn't find them before because I couldn't compile the plugin without the
library at hand.
I didn't find them before because I couldn't compile the plugin without the
library at hand.
configure.in: Change the libvirt detection so it works with my non-standard path.
libvirtstats plugin: Minor cleanups.
contrib/collection.cgi: Fix the types related to the processes plugin.
contrib/collection.cgi: Fix the ps_rss graph.
contrib/collection.cgi: Add some missing types and labels.
src/Makefile.am: Fix "make dist" to include utils_threshold.h
Hello,
Attached is a trivial Makefile patch so that when using "make dist", you
actually get the src/utils_threshold.h file, which is needed to successfully
build.
Signed-off-by: Chris Lalancette <clalance@redhat.com>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
Hello,
Attached is a trivial Makefile patch so that when using "make dist", you
actually get the src/utils_threshold.h file, which is needed to successfully
build.
Signed-off-by: Chris Lalancette <clalance@redhat.com>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
libvirtstats plugin: Add the `HostnameFormat' option.
This is something I missed out of the previous patch: I want a way to log
guests using their UUID instead of their name (more useful for us because of
the migration and other issues outlined before).
This adds:
<Plugin libvirtstats>
HostnameFormat "uuid"
</Plugin>
to let us do that. You can do other things as well such as:
HostnameFormat "name uuid"
to get "foo:1234-1234-1234-1234" as the hostname.
Rich.
This is something I missed out of the previous patch: I want a way to log
guests using their UUID instead of their name (more useful for us because of
the migration and other issues outlined before).
This adds:
<Plugin libvirtstats>
HostnameFormat "uuid"
</Plugin>
to let us do that. You can do other things as well such as:
HostnameFormat "name uuid"
to get "foo:1234-1234-1234-1234" as the hostname.
Rich.
Merge branch 'rj/libvirtstats'
Conflicts:
AUTHORS
Conflicts:
AUTHORS
configure.in: Fixed spaces followed by tabs and trailing whitespaces.
libvirtstats plugin: Added a plugin to collect virtual host statistics.
- rebased to git
- includes updates to the manpage
- ignorelist code now fixed
- removed debugging messages
Attached is a plugin allowing collectd to use libvirt to collect CPU, disk and
network statistics for domains.
Usage
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
- rebased to git
- includes updates to the manpage
- ignorelist code now fixed
- removed debugging messages
Attached is a plugin allowing collectd to use libvirt to collect CPU, disk and
network statistics for domains.
Usage
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
uuid plugin: Add a plugin which sets the hostname to an UUID.
Florian Forster wrote:
> Just out of curiosity: Why don't hostnames work for you?
For guests there's the question of what we put in the hostname field. The
previous plugin (libvirtstats) puts the guest's name in this field, but there
are some problems with this:
physicalserver1 <--- (hostname of physical server)
|
\--- database <--- (name of guest)
\--- web
physicalserver2
|
\--- database
\--- web
coldbackupserver
|
(no guests)
Guest names aren't really unique. Different physical servers may have guests
with overlapping names as in the example above. Also guest names aren't fixed.
Xen in particular renames guests at will. For example if a guest is about to
migrate then Xen renames the guest as 'migrating-foo' and if the guest is about
to shutdown Xen renames it as 'Zombie-foo'. The administrator of the physical
server can also rename guests.
While you're migrating you'll have an intermediate situation like this:
physicalserver1
|
\--- migrating-database
\--- migrating-web |
| migration
coldbackupserver |
| V
\--- database
\--- web
During live migrations the old instance ('migrating-foo') is still running.
The UUID is unique across physical servers, and is copied by migration and
preserved across shutdowns so if you care about which guest your stats "really"
came from then only the UUID tells you this.
Guests also have a hostname which is separate from the guest's name (the
guest's name is stored in the hypervisor, the hostname is stored inside the
guest's kernel). However it's not feasible to access the guest's hostname from
the hypervisor since this would involve some sort of snooping into the guest
kernel. The guest might be running Windows or FreeBSD etc. The only feasible
way to get this is to run an instance of collectd inside each guest, but then
the uuid plugin will also work in this scenario and can get the UUID since it
is exposed inside the guest either through an emulated BIOS or in
/sys/hypervisor/uuid.
Rich.
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
Florian Forster wrote:
> Just out of curiosity: Why don't hostnames work for you?
For guests there's the question of what we put in the hostname field. The
previous plugin (libvirtstats) puts the guest's name in this field, but there
are some problems with this:
physicalserver1 <--- (hostname of physical server)
|
\--- database <--- (name of guest)
\--- web
physicalserver2
|
\--- database
\--- web
coldbackupserver
|
(no guests)
Guest names aren't really unique. Different physical servers may have guests
with overlapping names as in the example above. Also guest names aren't fixed.
Xen in particular renames guests at will. For example if a guest is about to
migrate then Xen renames the guest as 'migrating-foo' and if the guest is about
to shutdown Xen renames it as 'Zombie-foo'. The administrator of the physical
server can also rename guests.
While you're migrating you'll have an intermediate situation like this:
physicalserver1
|
\--- migrating-database
\--- migrating-web |
| migration
coldbackupserver |
| V
\--- database
\--- web
During live migrations the old instance ('migrating-foo') is still running.
The UUID is unique across physical servers, and is copied by migration and
preserved across shutdowns so if you care about which guest your stats "really"
came from then only the UUID tells you this.
Guests also have a hostname which is separate from the guest's name (the
guest's name is stored in the hypervisor, the hostname is stored inside the
guest's kernel). However it's not feasible to access the guest's hostname from
the hypervisor since this would involve some sort of snooping into the guest
kernel. The guest might be running Windows or FreeBSD etc. The only feasible
way to get this is to run an instance of collectd inside each guest, but then
the uuid plugin will also work in this scenario and can get the UUID since it
is exposed inside the guest either through an emulated BIOS or in
/sys/hypervisor/uuid.
Rich.
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
Merge branch 'collectd-4.1' into collectd-4.2
Conflicts:
contrib/README
src/snmp.c
src/types.db
Conflicts:
contrib/README
src/snmp.c
src/types.db
snmp plugin: Don't try to free the request PDU - it segfaults for some reason.
According to other code I've seen this is never done by anyone else, so this
must mean that the snmp library takes care of this somehow. Man, I love well
documented libraries!
According to other code I've seen this is never done by anyone else, so this
must mean that the snmp library takes care of this somehow. Man, I love well
documented libraries!
snmp plugin: Be even more eager to free PDU structures.
snmp plugin: (Hopefully) fix a memory leak.
contrib/snmp-data.conf: Added even more UPS stuff.
contrib/fedora/collectd.spec: Updated for version 4.2.0
exec plugin: Allow arguments to be passed to the executed scripts.
Untested! Also, you can use the new config option `NagiosExec' to execute
Nagios scripts. The not yet implemented `NotificationExec' is supposed to
dispatch notifications to executables.
Untested! Also, you can use the new config option `NagiosExec' to execute
Nagios scripts. The not yet implemented `NotificationExec' is supposed to
dispatch notifications to executables.
exec plugin: Set PID of failed programs back to zero.
Otherwise the program will not be executed ever again after it failed once.
Otherwise the program will not be executed ever again after it failed once.
exec plugin: Added markers to fold methods in vim.
contrib/exec-munin.px: Added a simple Perl script which makes it possible to use Munin plugins in collectd.
The script has an embedded POD documentation.
The script has an embedded POD documentation.
src/utils_threshold.c: Added creation of a notification.
src/utils_threshold.[ch]: Added `ut_check_threshold' to check values against the configures thesholds.
This function is called from `plugin_dispatch_values' and prints a warning when
the values is outside of the configured threshold.
This function is called from `plugin_dispatch_values' and prints a warning when
the values is outside of the configured threshold.
Merge branch 'pull/collectd-4.1' into collectd-4.1
tcpconns plugin: Done complain when reading one of the files fails.
This should remove an error message on non-IPv6-enabled hosts..
This should remove an error message on non-IPv6-enabled hosts..
src/configfile.c: Handle the `<Threshold>' block correctly.
I. e. pass it to `ut_config'.
I. e. pass it to `ut_config'.
src/utils_threshold.[ch]: Added the header file and initialize the AVL tree.
contrib/snmp-data.conf: Added some more RMSes and UPS stuff.
Merge branch 'collectd-4.2'
Merge branch 'collectd-4.1' into collectd-4.2
Conflicts:
src/collectd-snmp.pod
Conflicts:
src/collectd-snmp.pod
types.db: Fix a typo: s/humitidy/humidity/
types.db: Ordered the entries alphabetically and added `voltage_threshold'.
rrdtool plugin: Wait for the ``queue thread'' to exit _after_ signaling it to exit..
collectd-snmp(5): Fix typos.
src/utils_threshold.c: Added configuration code for threshold values.
The new module `utils_threshold' is supposed to check values and create and
dispatch a notification when the value is not within the threshold.
So far the code is only able to parse a configuration - and even that is
untested so far. It compiles, though ;)
The new module `utils_threshold' is supposed to check values and create and
dispatch a notification when the value is not within the threshold.
So far the code is only able to parse a configuration - and even that is
untested so far. It compiles, though ;)
src/utils_cache.c: Initialize the mutex correctly.
src/plugin.[ch]: Added a notification type and auxiliary functions.
src/utils_cache.c: Detect when a counter wraps around
and calculate the difference correctly.
and calculate the difference correctly.
collectd.conf: Added nginx module.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
src/utils_cache.[ch]: Added a global cache for all values that are dispatched.
The cache translates counter values to gauge values using the last counter
value available. This can then be used to check against threshold values, as
we'll need to do for monitoring functionality.
Right now the cache doesn't do much: It sits there and caches the values, but
is not yet ever queried. The already implemented (but so far unused) function
`uc_get_rate' returns an array of gauge_t values.
The longterm goal is to have the network, rrdtool and unixsock plugins use this
cache, too. This will require some `plugin specific' data with appropriate
control structures and, which is likely the hardest part, some clever locking
for all that.
The cache translates counter values to gauge values using the last counter
value available. This can then be used to check against threshold values, as
we'll need to do for monitoring functionality.
Right now the cache doesn't do much: It sits there and caches the values, but
is not yet ever queried. The already implemented (but so far unused) function
`uc_get_rate' returns an array of gauge_t values.
The longterm goal is to have the network, rrdtool and unixsock plugins use this
cache, too. This will require some `plugin specific' data with appropriate
control structures and, which is likely the hardest part, some clever locking
for all that.
perl plugin: Set $0 to "collectd".
perl_parse() has to set it to "-e" which is not very meaningful. It would
be even nicer to set it to argv[0] but this is not available from inside
the plugin.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
perl_parse() has to set it to "-e" which is not very meaningful. It would
be even nicer to set it to argv[0] but this is not available from inside
the plugin.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
collectd.h: Removed legacy definition of operation modes.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
plugin.h: Make DEBUG() a noop when compiling without debugging support.
This saves a couple of useless calls to plugin_log() which the compiler
does not detect and remove itself.
A couple of DEBUG()'s in the apcups, hddtemp, mbmon and ntpd plugins have
been upgraded to INFO()'s. All of them provide error messages of failed
system / libc calls which should be available to the user somehow.
Besides, they use a local string buffer which generates an "unused
variable" warning if DEBUG() expands to a noop.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
This saves a couple of useless calls to plugin_log() which the compiler
does not detect and remove itself.
A couple of DEBUG()'s in the apcups, hddtemp, mbmon and ntpd plugins have
been upgraded to INFO()'s. All of them provide error messages of failed
system / libc calls which should be available to the user somehow.
Besides, they use a local string buffer which generates an "unused
variable" warning if DEBUG() expands to a noop.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
ChangeLog: Fix some spelling errors.
Build system: Removed the check for `libm'.
It didn't work (there's no `ext' function) and wasn't used anywhere..
It didn't work (there's no `ext' function) and wasn't used anywhere..
Merge branch 'collectd-4.1'
Bumped version to 4.2.0; Updated ChangeLog.
17 years agoBuild system: Changed the detection of the sensors library to work like other libraries.
Build system: Changed the detection of the sensors library to work like other libraries.
README: Added section about configuring, building and installing collectd.
This section contains basic information about the "--enabled-<plugin>"
configuration option as well as adopting the installation target.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
This section contains basic information about the "--enabled-<plugin>"
configuration option as well as adopting the installation target.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
collectd.conf(5): Fix a typo.
ChangeLog: Added a note about the new nginx plugin.
src/common.c: Serialize access to `strerror' if `strerror_r' doesn't exist.
Apparently this is a problem under Solaris 9..
Apparently this is a problem under Solaris 9..
Build system: Fixed a bug in the detection of the snmp library.
Hello,
During the creation of a rpm on Mandriva 2007.1 from tar.bz2 sources, and by
activate almost all options, I found something that seems a bug to me in the
configure file, line 33251 (concerning the snmp plugin)
Hello,
During the creation of a rpm on Mandriva 2007.1 from tar.bz2 sources, and by
activate almost all options, I found something that seems a bug to me in the
configure file, line 33251 (concerning the snmp plugin)
Merge branch 'collectd-4.1'
logfile plugin: Implemented an option to prefix logged lines with a timestamp.
Build system: Set the appropriate CPPFLAGS and LDFLAGS when checking for librrd and it's header.
rrdtool plugin: Include the `rrd.h' header file in `rrdtool.c', not `collectd.h'.
This caused an error when --with-rrdtool was used to have the header file in a
non-standard directory, because the appropriate CFLAGS were not passed to all
plugins.
This caused an error when --with-rrdtool was used to have the header file in a
non-standard directory, because the appropriate CFLAGS were not passed to all
plugins.
types.db: Raise the maximum value of `ps_cputime' from 1s/1s to 16s/1s..
This should work with machines with up to 16 processors..
This should work with machines with up to 16 processors..
ChangeLog: Documented the new tcpconns plugin and the changes to the snmp plugin.
README: Improved the dependency list a little.
ChangeLog: Fixed many many typos.
Fixed some typos in the manpages.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
Merge branch 'collectd-4.1'
Conflicts:
ChangeLog
contrib/PerlLib/Collectd.pm
Conflicts:
ChangeLog
contrib/PerlLib/Collectd.pm
Bumped version to 4.1.3; Updated ChangeLog.
contrib/PerlLib/Collectd.pm: Bumped version to 4.1.3.
Merge branch 'collectd-4.1'
configure.in: Added "rrdtool" to the module summary.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
collectd-perl(5): Added note about multi-threading.
A new section "BUGS" has been added to the manpage with a short note about
Perl and multithreading.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
A new section "BUGS" has been added to the manpage with a short note about
Perl and multithreading.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
perl plugin: Improved value list conversion.
The perl plugin used to store an internal list of data-source types for
each data-set registered by Perl plugins to get fast access to this
information (which is required to correctly convert a Perl data-set to a
data_set_t struct). However, this prevented Perl plugins to use data-sets
defined in types.db. This patch fixes this issue by requesting the
data-set definition from collectd.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
The perl plugin used to store an internal list of data-source types for
each data-set registered by Perl plugins to get fast access to this
information (which is required to correctly convert a Perl data-set to a
data_set_t struct). However, this prevented Perl plugins to use data-sets
defined in types.db. This patch fixes this issue by requesting the
data-set definition from collectd.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
perl plugin: Fixed handling of erroneous configuration options.
An empty block was used instead of returning from the perl_config_*()
functions in case of an error. I wonder how that has happened... :-/
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
An empty block was used instead of returning from the perl_config_*()
functions in case of an error. I wonder how that has happened... :-/
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
perl plugin: Improved "IncludeDir" configuration option.
The "Do not initialize the Perl interpreter until loading a module."
commit removed support for adding include directories after the Perl
interpreter has been initialized. This patch re-enables it.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
The "Do not initialize the Perl interpreter until loading a module."
commit removed support for adding include directories after the Perl
interpreter has been initialized. This patch re-enables it.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
collectd-perl(5): Updated documentation.
* moved configuration documentation from collectd.conf(5) to
collectd-perl(5)
* added documentation for the EnableDebugger configuration option
* added documentation about how to write own plugins
* added exports and examples section
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
* moved configuration documentation from collectd.conf(5) to
collectd-perl(5)
* added documentation for the EnableDebugger configuration option
* added documentation about how to write own plugins
* added exports and examples section
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
collectd.conf.in: Fixed some missing quotes and words..
Merge branch 'ad/memcached'
AUTHORS, ChangeLog: Added notes about the memcached plugin.
collectd.conf.in: Added the `memcached' plugin.
Merge branch 'pull/master'
collectd.conf(5): Documented the new memcached plugin.
Merge branch 'master' into ad/memcached
Conflicts:
src/types.db
Conflicts:
src/types.db
collectd.conf(5): Documented the new nginx plugin.
memcached plugin: Corrected the copyright notice and removed unnecessary header files.
email plugin: Include `stddef.h' which defines the `offsetof' macro.
memcached plugin: Some of the data definitions have been torn appart.
memcached plugin: Added a plugin to query stats from memcached servers.
nginx plugin: Changed to the version 4 plugin infrastructure.
Merge branch 'ff/nginx'
Conflicts:
configure.in
src/Makefile.am
Conflicts:
configure.in
src/Makefile.am