[collectd] OpenVPN plugin 2.0

Marco Chiappero marco at absence.it
Sat Sep 19 15:53:22 CEST 2009


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.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: types.patch
Type: text/x-patch
Size: 481 bytes
Desc: not available
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20090919/85863ea5/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: openvpn.name.c
Type: text/x-csrc
Size: 14287 bytes
Desc: not available
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20090919/85863ea5/attachment.c 


More information about the collectd mailing list