src/filter_chain.c: Fixed typos in error messages

Signed-off-by: Florian Forster <octo@collectd.org>
src/utils_random.[ch]: Provide thread-safe random numbers.
rrdtool plugin: Use cdrand_range() for the random variation.
configure.in: Fix quoting of AC_LANG_PROGRAM().

Autoconf 2.68 complains about that and aborts building the configure
script. *sigh*
mysql plugin: Call mysql_init() only once.

Apparently, if you call it with a structure allocated by mysql_init()
itself, it leaks memory. Thanks to Yves Mettier for pointing this out!

Fixes Github issue #274.
Allow parsing plugin_instance in parse_option().

isalnum() is not enough to catch the underscore.

Signed-off-by: Florian Forster <octo@collectd.org>
thermal plugin: fixed value submitting

Signed-off-by: Markus Knetschke <markus.knetschke@gmail.com>
Signed-off-by: Florian Forster <octo@collectd.org>
thermal plugin: set the hostname

Signed-off-by: Markus Knetschke <markus.knetschke@gmail.com>
Signed-off-by: Florian Forster <octo@collectd.org>
configure.in: Yet another attempt at fixing the mess that is AC_LANG_PROGRAM().
csnmp_read_table: Change GETNEXT request behaviour (+ bugfix 235)

This patch changes the snmp GETNEXT request behaviour implemented in snmp.c.

The old implementation requested all OIDs using GETNEXT requests until all OIDs
left their own subtree. In cases were trees in a Data template are much longer
than other trees the shorter subtrees were re-requested over and over again.

The new implementation will only request OIDs that did not already leave their
subtrees (see the oid_todo_list implementation for details). This renders the
function csnmp_check_res_left_subtree useless as the oid_todo_list keeps track
if all OIDs have finished.

During tests against Cat6500 (CatOS/IOS) as well as Nexus5k (NX-OS) it looks as
though GETNEXT requests (when requesting multiple OIDs like all 14 dot3Stats
errors from Etherlike-MIB) can take about 5-10ms (CatOS 30ms) longer if they wrap
to the next OID.

This does not sound much but when collecting data for the Etherlike-MIB (that only
has entries for physical interfaces) with a collectd "Instance" variable in IF-MIB
(that has entries for all physical as well as pseudo [SVIs, VLANs, ...] interfaces)
this can make a notable difference (e.g. for core routers that have all SVIs and
VLANs but only some switches attached):

IOS-Core-Router   ifName                 550 entries
                  dot3StatsFCSErrors      70 entries
                                        ------------
                                         480 entries * 10ms =  4.8s overhead

CatOS-Access-Sw.  ifName                 840 entries
                  dot3StatsFCSErrors     490 entries
                                        ------------
                                         350 entries * 30ms = 10.5s overhead

After refactoring csnmp_read_table "Instance" and "Value" OIDs are now handled
consistently (so no pointer-forward foo needed). It doesn't change any logic
and data structures, though - so there should not be any impact to other
functions.

The refactored code also fixes GitHub bugs #235 and #258. This bug is due to
reusing the status variable in following code section which might lead to errors
if the subtrees are of different length:

1436    /* Calculate the current suffix. This is later used to check that the
1437     * suffix is increasing. This also checks if we left the subtree */
1438    status = csnmp_oid_suffix (&suffix, &vb_name, data->values + i);

Signed-off-by: Florian Forster <octo@collectd.org>
snmp plugin: Some coding style fixes.

* Rename "oid_todo_list" to "oid_list_todo".
* Rename "j" to "oid_list_todo_num".
* Fix indentation.
* Declare variables at beginning of block.
snmp plugin: Allocate "oid_list" on the stack.
src/libcollectdclient/network_buffer.c check for htonll exitence
before defining it. I have to to this to get it compiled on AIX6

Signed-off-by: Florian Forster <octo@collectd.org>
Merge branch 'collectd-5.1' into collectd-5.2
rrdcached plugin: Connect to the daemon in the read() callback.

Fixes Github issue #275. Thanks to Yves Mettier for reporting this bug!
nfs plugin: Copy the name before calling the non-const lookup function.

Fixes Github issue #70. Thanks to Jeff for reporting this issue.
snmp plugin: Fix compilation issue.

Thanks to Magnus for pointing this out.
netapp plugin: Fix intervals used when dispatching values.

It used to use the interval of the <Host /> block when in fact it should
have used the interval of the data blocks.

Fixes Github issue #288.
configure.in: Check for protobuf-c.h.

Thanks to Yves Mettier pointing this out in #269 and for providing an
initial patch.
notify_email: Add charset in Content-Type header (seems required by some picky spam filters)

Signed-off-by: Florian Forster <octo@collectd.org>