openvpn plugin: Use tabs for indentation only.
Whitespace-only commit.
Whitespace-only commit.
openvpn plugin: multi1_read: Replace a hard to read for-loop with a while-loop.
openvpn plugin: Improve “version_detect”.
Remove “fscanf” with used the insecure “%s” format string. Pass the
filename rather than the file handle to the function.
Remove “fscanf” with used the insecure “%s” format string. Pass the
filename rather than the file handle to the function.
openvpn plugin: Remove trailing whitespace.
openvpn plugin: Don't use negated config options.
“NoCompression” → “Compression”.
“NoCompression” → “Compression”.
openvpn plugin: Add forgotten frees.
Florian Forster ha scritto:
> Hi Marco,
Hi Florian,
> I'm too tired to have a look at this now, I hope to have some time in
> the next few days. I'll come back to you asap.
That's fine :)
But sorry, I forgot to recheck a small part of the code after adding and
moving some stuff around, please apply this patch too.
Regards,
Marco
Florian Forster ha scritto:
> Hi Marco,
Hi Florian,
> I'm too tired to have a look at this now, I hope to have some time in
> the next few days. I'll come back to you asap.
That's fine :)
But sorry, I forgot to recheck a small part of the code after adding and
moving some stuff around, please apply this patch too.
Regards,
Marco
openvpn plugin: Add support for more versions of the “status file” (and more).
Hi all,
I have some news regarding the Openvpn plugin.
I recently upgraded to 4.7.2 and enabled the new (to me) openvpn plugin,
but unfortunately it didn't work and I couldn't understand why. So had a
look at the code and applied some changes. Here a list of things
added:
- support for multiple vpn/status files
- support for single endpoint status file and for multicontext version
1,3 (currently every status file type is supported)
- status file type auto-detection
- collection of overhead and compression stats for single mode status files
- "NoCompression" option to disable compression statistics collection
- new file naming schema correcting the previous wrong one
- debug and error output
The plugin has already been tested with my own openvpn setup and many
different files found on the net, but two major aspects have to be taken
into consideration. The first one is the new overhead collection and the
change in the compression statistics (now data is stored as they are
[1]). However, due to a bug in the previous code, no compression
collection was working and so the new one is not going to brake backward
compatibility. Unfortunately backward compatibility is broken by the
new naming schema, more collectd compliant (and necessary with multiple
conf/status files support). So plugin_istance is now the status file
name (or the status entry number), while the plugin_type is now the
hostname when in multicontext mode or the traffic and overhead when in
single.
About the plugin_instance value, I started using numbers like the cpu
plugin does, but I prefer to use the self explanatory file name, helping
in finding the right vpn and avoiding to mess things up when adding a
new status file. The downside is that filenames have to be unique (man
pages should mention this [2]), therefore I added a check. Nonetheless I
think it's very unlikely to happen, it is quite rare to find many vpn on
the same system and it's really hard to have the same log filename
stored in different dirs rather than the opposite; usually to different
tunnels should already correspond different status log name.
However, Florian, feel free to choose the other method if you prefer, I
can send you a patch to revert to the number based schema.
Hope you like the code.
Regards,
Marco
[1] This allows to retrieve multiple informations, not just the pure
compression ratio. For example we can now calculate the pure compression
ratio, the global compression level, the byte saved (eg. for a
overhead vs. saved bytes graph) and so on.
[2] Man pages should be updated as well, but I haven't written anything yet.
Hi all,
I have some news regarding the Openvpn plugin.
I recently upgraded to 4.7.2 and enabled the new (to me) openvpn plugin,
but unfortunately it didn't work and I couldn't understand why. So had a
look at the code and applied some changes. Here a list of things
added:
- support for multiple vpn/status files
- support for single endpoint status file and for multicontext version
1,3 (currently every status file type is supported)
- status file type auto-detection
- collection of overhead and compression stats for single mode status files
- "NoCompression" option to disable compression statistics collection
- new file naming schema correcting the previous wrong one
- debug and error output
The plugin has already been tested with my own openvpn setup and many
different files found on the net, but two major aspects have to be taken
into consideration. The first one is the new overhead collection and the
change in the compression statistics (now data is stored as they are
[1]). However, due to a bug in the previous code, no compression
collection was working and so the new one is not going to brake backward
compatibility. Unfortunately backward compatibility is broken by the
new naming schema, more collectd compliant (and necessary with multiple
conf/status files support). So plugin_istance is now the status file
name (or the status entry number), while the plugin_type is now the
hostname when in multicontext mode or the traffic and overhead when in
single.
About the plugin_instance value, I started using numbers like the cpu
plugin does, but I prefer to use the self explanatory file name, helping
in finding the right vpn and avoiding to mess things up when adding a
new status file. The downside is that filenames have to be unique (man
pages should mention this [2]), therefore I added a check. Nonetheless I
think it's very unlikely to happen, it is quite rare to find many vpn on
the same system and it's really hard to have the same log filename
stored in different dirs rather than the opposite; usually to different
tunnels should already correspond different status log name.
However, Florian, feel free to choose the other method if you prefer, I
can send you a patch to revert to the number based schema.
Hope you like the code.
Regards,
Marco
[1] This allows to retrieve multiple informations, not just the pure
compression ratio. For example we can now calculate the pure compression
ratio, the global compression level, the byte saved (eg. for a
overhead vs. saved bytes graph) and so on.
[2] Man pages should be updated as well, but I haven't written anything yet.
Various plugins: Remove trailing whitespaces.
Merge branch 'collectd-4.8'
snmp plugin: Rename a variable (missed during merge).
Merge branch 'collectd-4.8'
Merge branch 'collectd-4.7' into collectd-4.8
Conflicts:
src/snmp.c
Conflicts:
src/snmp.c
contrib/snmp-data.conf: Add support for Mikrotik RouterBoards.
snmp plugin: Fix handling of strings with control characters.
If a byte of a string has a value <32, the string is printed as a
hex-string. This fixes issues with some devices returning MAC addresses
as "strings".
If a byte of a string has a value <32, the string is printed as a
hex-string. This fixes issues with some devices returning MAC addresses
as "strings".
snmp plugin: Fix handling of negative values.
src/Makefile: Support parallel builds when creating the manpages.
A temporary file name is used when creating the manpages. So far, a static
file name had been used for that, thus causing race conditions. Now, a unique
suffix (PID) is used to fix that.
Thanks to BC^bd for reporting that on IRC!
A temporary file name is used when creating the manpages. So far, a static
file name had been used for that, thus causing race conditions. Now, a unique
suffix (PID) is used to fix that.
Thanks to BC^bd for reporting that on IRC!
rrdcached plugin: Work around a bug in RRDtool 1.4rc2.
rrd_client.h in that pre-release checked for HAVE_CONFIG_H and would then try
to include rrd_config.h, which, obviously, is not available in collectd.
rrd_client.h in that pre-release checked for HAVE_CONFIG_H and would then try
to include rrd_config.h, which, obviously, is not available in collectd.
GenericJMX plugin: Close and re-open the connection upon I/O-errors.
kern.cp_times needs array of length kern.smp.maxcpus
surpress gcc warnings on FreeBSD
cc1: warnings being treated as errors
processes.c: In function 'ps_read':
processes.c:343: warning: 'pse.io_rchar' is used uninitialized in this function
processes.c:1436: note: 'pse.io_rchar' was declared here
processes.c:344: warning: 'pse.io_wchar' is used uninitialized in this function
processes.c:1436: note: 'pse.io_wchar' was declared here
processes.c:345: warning: 'pse.io_syscr' is used uninitialized in this function
processes.c:1436: note: 'pse.io_syscr' was declared here
processes.c:346: warning: 'pse.io_syscw' is used uninitialized in this function
processes.c:1436: note: 'pse.io_syscw' was declared here
cc1: warnings being treated as errors
processes.c: In function 'ps_read':
processes.c:343: warning: 'pse.io_rchar' is used uninitialized in this function
processes.c:1436: note: 'pse.io_rchar' was declared here
processes.c:344: warning: 'pse.io_wchar' is used uninitialized in this function
processes.c:1436: note: 'pse.io_wchar' was declared here
processes.c:345: warning: 'pse.io_syscr' is used uninitialized in this function
processes.c:1436: note: 'pse.io_syscr' was declared here
processes.c:346: warning: 'pse.io_syscw' is used uninitialized in this function
processes.c:1436: note: 'pse.io_syscw' was declared here
Merge branch 'collectd-4.8'
Merge branch 'collectd-4.7' into collectd-4.8
Conflicts:
.gitignore
Conflicts:
.gitignore
contrib/collectd_unixsock.py: Support all plain text protocol commands
Also rename class from Collect to Collectd and improve output when run
as standalone script.
Also rename class from Collect to Collectd and improve output when run
as standalone script.
contrib/collectd_unixsock.py: Follow Python PEP-8 syntax requirements.
Also remove comment which seems to refer to a file outside of the
collectd project.
Also remove comment which seems to refer to a file outside of the
collectd project.
gitignore: Ignore compiled python files
Replace dashes with underscores in python modules
It's not possible to import python modules with dashes in the name.
See http://bit.ly/2t7fcy for more information.
It's not possible to import python modules with dashes in the name.
See http://bit.ly/2t7fcy for more information.
Ignore more java bindings classes
processes plugin: Rename the new types and use DERIVE data sources.
This is probably a much safer choice in this case.
This is probably a much safer choice in this case.
processes plugin: Make “ps_read_io” static.
processes plugin: Add collection of IO-metrics.
I attach a patch for collectd-4.8.0 adding a new feature which read IO
data for a process using /proc/<pid>/io (only works on linux > 2.6.20),
it's very usefull to monitoring disk throughput and what process is
related with high disk IO. I'm using this patchs for days in some
database environments with good results, but I think that is not enough
stable yet (more testing is required). The patch read from
/proc/<pid>/io (where available) the data for syscr and syscw (read and
write operations) and rchar and wchar (read and write bytes).
I attach a patch for collectd-4.8.0 adding a new feature which read IO
data for a process using /proc/<pid>/io (only works on linux > 2.6.20),
it's very usefull to monitoring disk throughput and what process is
related with high disk IO. I'm using this patchs for days in some
database environments with good results, but I think that is not enough
stable yet (more testing is required). The patch read from
/proc/<pid>/io (where available) the data for syscr and syscw (read and
write operations) and rchar and wchar (read and write bytes).
Merge branch 'collectd-4.8'
Merge branch 'collectd-4.7' into collectd-4.8
configure.in: Fix auxiliary NetApp libraries.
gmond plugin: Fixed a typo.
For some reason, the value_t members "derive" and "absolute" had been spelled
in all capital letters, obviously resulting in a build error.
For some reason, the value_t members "derive" and "absolute" had been spelled
in all capital letters, obviously resulting in a build error.
collectd.conf: Added the "madwifi" and "match_empty_counter" plugins.
Fixed a bug with newer NetApp Versions.
NetApp OnTAP API 7.3 and newer actually read this field and
expect the value "counter".
NetApp OnTAP API 7.3 and newer actually read this field and
expect the value "counter".
README: Added missing prerequisites.
network plugin: Implement statistics collection about the plugin itself.
configure.in: Don't use “find -L”.
Apparently the “-L” is a (new) GNU extension. :/
Apparently the “-L” is a (new) GNU extension. :/
collectd-snmp(5): Fix a typo.
Thanks to mspo.
Thanks to mspo.
hashed match: Add a match to simplify load balancing.
netapp plugin: Use a separate read-thread for each host.
Possibly not as efficient as one thread for each metric, but better than
collecting this sequentially any day.
Possibly not as efficient as one thread for each metric, but better than
collecting this sequentially any day.
ChangeLog: Fix a stupid typo.
Bumped version to 4.8.1; Updated ChangeLog.
Merge branch 'collectd-4.7' into collectd-4.8
Conflicts:
ChangeLog
version-gen.sh
Conflicts:
ChangeLog
version-gen.sh
Bumped version to 4.7.4; Updated ChangeLog.
contrib/collection3: Improve configuration for "df_complex".
Various plugins: Use the IS_TRUE and IS_FALSE macros everywhere.
contextswitches, processes plugins: Don't print an error if number of fields don't match.
Because we pick the required line further down, having lines with more
fields is not illegal anymore.
Thanks to Patrik Weiskircher for noticing :)
Because we pick the required line further down, having lines with more
fields is not illegal anymore.
Thanks to Patrik Weiskircher for noticing :)
df plugin: Implement the "ReportInodes" option.
This option can be used to enable / disable inode statistics collection.
Defaults to "false" for now.
This option can be used to enable / disable inode statistics collection.
Defaults to "false" for now.
df plugin: Implement the "ReportReserved" option.
When enabled, the reserved space is reported separately. The "df_complex"
type is used and the mount point or device name is used as plugin instance
(as it should be) instead of the type instance (which is now needed for
"free", "reserved" and "used").
The INode handling has been split up in the same manner.
When enabled, the reserved space is reported separately. The "df_complex"
type is used and the mount point or device name is used as plugin instance
(as it should be) instead of the type instance (which is now needed for
"free", "reserved" and "used").
The INode handling has been split up in the same manner.
AUTHORS: Added Patrik.
README: Added the contextswitch plugin.
Merge branch 'collectd-4.8'
Conflicts:
src/df.c
Conflicts:
src/df.c
Merge branch 'collectd-4.7' into collectd-4.8
Conflicts:
README
Conflicts:
README
README: Fix order of the curl_json plugin in the list.
README: Fix order of the curl plugin in the list.
contextswitch plugin: Only submit if we actually did find a value.
Also makes parsing more robust (strncmp would allow for garbage after the key,
strtoul does not overflow when given an invalid string).
Also makes parsing more robust (strncmp would allow for garbage after the key,
strtoul does not overflow when given an invalid string).
processes plugin: Don't *abort* if a line has more than two fields.
Added contextswitch plugin (for linux).
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
processes plugin: Improve the error handling.
The fork-rate function now returns ULONG_MAX upon error. The error detection
when using strtoul has been improved (overflow is not the only possible error).
The fork-rate function now returns ULONG_MAX upon error. The error detection
when using strtoul has been improved (overflow is not the only possible error).
Added fork rate collecting to processes plugin.
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
df plugin: Fix a typo.
df plugin also collects inode count now.
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
Merge branch 'collectd-4.8'
Conflicts:
src/types.db
Conflicts:
src/types.db
Merge branch 'collectd-4.7' into collectd-4.8
src/types.db: Replace spaces with tabs.
src/types.db: Replace spaces with tabs.
src/plugin.c: plugin_log: Print to stderr if no log plugin has been loaded.
Merge commit 'octo/master'
Added new netapp data types to types.db.
include netinet/in.h for sockaddr_in on FreeBSD
Fixes:
common.c: In function 'service_name_to_port_number':
common.c:1112: error: dereferencing pointer to incomplete type
common.c:1119: error: dereferencing pointer to incomplete type
Fixes:
common.c: In function 'service_name_to_port_number':
common.c:1112: error: dereferencing pointer to incomplete type
common.c:1119: error: dereferencing pointer to incomplete type
unixsock plugin: Fix a (well hidden) race condition.
Within the client handling thread, fdopen is called twice on the file
descriptor passed to the thread. Later those file handles are closed like:
fclose (fhin);
fclose (fhout);
This is a race condition, because the first call to fclose will close the file
descriptor. The second call to fclose will try the same. Usually, it would fail
silently and all is well. On a busy machine, however, another thread may just
have opened a file or accepted a socket. In that case an arbitrary file
descriptor is closed. If the file descriptor is opened yet again fast enough,
data may even end up in a totally wrong location.
As a work-around the file descriptor is not dup'ed so each fdopen operates on
its own file descriptor. As an alternative the "r+" mode and a single file
handle may be suitable, too.
Many thanks to Sven Trenkel for pointing me into the right directioin :)
Within the client handling thread, fdopen is called twice on the file
descriptor passed to the thread. Later those file handles are closed like:
fclose (fhin);
fclose (fhout);
This is a race condition, because the first call to fclose will close the file
descriptor. The second call to fclose will try the same. Usually, it would fail
silently and all is well. On a busy machine, however, another thread may just
have opened a file or accepted a socket. In that case an arbitrary file
descriptor is closed. If the file descriptor is opened yet again fast enough,
data may even end up in a totally wrong location.
As a work-around the file descriptor is not dup'ed so each fdopen operates on
its own file descriptor. As an alternative the "r+" mode and a single file
handle may be suitable, too.
Many thanks to Sven Trenkel for pointing me into the right directioin :)
Merge branch 'st/netapp'
netapp plugin: Subtract snap_norm_used from norm_used in any case.
collectd.conf(5): Updated the “GetSnapshot” entry.
netapp plugin: Use the “volume-” prefix for all volume related data.
netapp plugin: Create a notification when a volume goes offline or comes back.
netapp plugin: cna_handle_volume_snap_usage: Explain what's going on in a comment.
Fixed VolumePerf data collection.
Merge commit 'remotes/octo/st/netapp' into st/netapp
Added snapshot usage stats.
Build system: Link the netapp plugin with libnetapp.
D'oh! ;)
D'oh! ;)
netapp plugin: Don't access a struct after freeing it.
Thanks Sven :)
Thanks Sven :)
netapp plugin: Add a shutdown callback.
netapp plugin: free_host_config: Close the connection if applicable.
collectd.conf(5): Document the “Interval” option in all blocks of the netapp plugin.
netapp plugin: Rename the “Capacity” and “Snapshot” options again.
They've been renamed to “GetCapacity” and “GetSnapshot” so the
names used within the “VolumeUsage” block are the same as the names
used elsewhere in the plugin.
They've been renamed to “GetCapacity” and “GetSnapshot” so the
names used within the “VolumeUsage” block are the same as the names
used elsewhere in the plugin.
netapp plugin: Remove left-over references to volume_t.
netapp plugin: Remove all left-over references to cfg_service_t.
netapp plugin: Refactor the VolumePerf collection.
Same procedure one last time. The “GetVolumePerfData” block has been
renamed to “VolumePerf”. The “Get{IO,Ops,Latency}” options now
use ignore lists, too. Appropriate “IgnoreSelected{IO,Ops,Latency}”
options have been introduced.
Same procedure one last time. The “GetVolumePerfData” block has been
renamed to “VolumePerf”. The “Get{IO,Ops,Latency}” options now
use ignore lists, too. Appropriate “IgnoreSelected{IO,Ops,Latency}”
options have been introduced.
netapp plugin: Set the HAVE_VOLUME_USAGE_SIS_SAVED after determining the value.
netapp plugin: Fix handling of the SIS value.
netapp plugin: Refactored volume usage statistics.
Much of this is like disk, wafl and system statistics before. The
“GetVolumeData” has been renamed to “VolumeUsage” and the
“GetDiskUtil” and “GetSnapUtil” options have been changed, too. The
configuration now looks like this:
<VolumeUsage>
Capacity "vol0"
Capacity "vol1"
IgnoreSelectedCapacity false
Snapshot "vol1"
Snapshot "vol3"
IgnoreSelectedSnapshot false
</VolumeUsage>
The code now uses to "ignore lists" to check whether capacity and/or
snapshot information should be collected for a volume. This means the
order in which volumes are listed no longer matters and than you can
use such advanced options as selecting volumes via regular expressions.
Much of this is like disk, wafl and system statistics before. The
“GetVolumeData” has been renamed to “VolumeUsage” and the
“GetDiskUtil” and “GetSnapUtil” options have been changed, too. The
configuration now looks like this:
<VolumeUsage>
Capacity "vol0"
Capacity "vol1"
IgnoreSelectedCapacity false
Snapshot "vol1"
Snapshot "vol3"
IgnoreSelectedSnapshot false
</VolumeUsage>
The code now uses to "ignore lists" to check whether capacity and/or
snapshot information should be collected for a volume. This means the
order in which volumes are listed no longer matters and than you can
use such advanced options as selecting volumes via regular expressions.
Fixed NULL pointer bug.
netapp plugin: Inform the user when he screwed up the disk and system blocks, too.
netapp plugin: Print a notice if all WAFL values have been disabled.
This message is printed if the user did supply a <WAFL /> block but
then disabled all supported values. WAFL collection will be disabled
in this case to increase performance.
This message is printed if the user did supply a <WAFL /> block but
then disabled all supported values. WAFL collection will be disabled
in this case to increase performance.
netapp plugin: Document the graceful return if statistics are not wanted.
Unfortunately this behavior isn't exactly obvious.
Unfortunately this behavior isn't exactly obvious.
netapp plugin: Refactor system statistics.
Same procedure as before: Instead of using the “service handler”,
create a cfg_system_t pointer if the user wants system statistics. Then
call cna_query_system instead of the service handler.
The “GetSystemPerfData” block has been renamed to “System” and the
“Multiplier” option has been replaced by the “Interval” option.
Same procedure as before: Instead of using the “service handler”,
create a cfg_system_t pointer if the user wants system statistics. Then
call cna_query_system instead of the service handler.
The “GetSystemPerfData” block has been renamed to “System” and the
“Multiplier” option has been replaced by the “Interval” option.
Merge remote branch 'trenkel/st/netapp' into st/netapp