The default hostname used by collectd is system dependent as retuned by
gethostname(3) (On FreeBSD it's the FQDN, while on Linux it's the
non-FQDN). The python method socket.gethostname() always return a
non-FQDN, and the user has the ability to tune the hostname as he wish
in the collectd configuration (hostname parameter).
This change allow to use a customized hostname by using an optional
argument "hostname". When not provided, the non-FQDN and the FQDN are
tried in turn to fetch the requested metric value.
Thank you for contributing to this project!
If you attempt to specify the collectd version in Hiera, and a newer version is available, issue might be caused because the package install of the plugins on new hosts would install the latest version for both the plugin and the main package (as a dependency). Puppet then starts failing attempting to downgrade the main package to your specified version.
With this PR it is ensure that mysql, snmp, and curl, are installed with the same version as the core package. Same thing was done for the disk plugin some time ago: https://github.com/voxpupuli/puppet-collectd/blob/master/manifests/plugin/disk.pp#L26L37
I don't believe the issue has yet been documented. Ideally this is done for all plugins.