From: Florian Forster Date: Mon, 22 Mar 2010 18:29:13 +0000 (+0100) Subject: Merge branch 'fs/openvpn' X-Git-Tag: collectd-4.10.0~52 X-Git-Url: https://git.octo.it/?a=commitdiff_plain;h=f4c25b4b234ba63fb9b15c2219d55d8af3e3f39d;p=collectd.git Merge branch 'fs/openvpn' Conflicts: src/collectd.conf.pod src/openvpn.c --- f4c25b4b234ba63fb9b15c2219d55d8af3e3f39d diff --cc src/collectd.conf.pod index a12a48b6,b1544e8d..facb0589 --- a/src/collectd.conf.pod +++ b/src/collectd.conf.pod @@@ -2776,14 -2776,7 +2776,14 @@@ Available options Specifies the location of the status file. +=item B B|B + +When enabled, the filename of the status file will be used as plugin instance +and the client's "common name" will be used as type instance. This is required +when reading multiple status files. Enabling this option is recommended, but to +maintain backwards compatibility this option is disabled by default. + - =item B B|B + =item B B|B Sets whether or not statistics about the compression used by OpenVPN should be collected. This information is only available in I mode. Enabled by diff --cc src/openvpn.c index 9c717dd0,8c0f82db..2aca4145 --- a/src/openvpn.c +++ b/src/openvpn.c @@@ -261,19 -290,27 +290,27 @@@ static int multi1_read (char *name, FIL if (fields_num < 4) continue; - if (new_naming_schema) + if (collect_user_count) + /* If so, sum all users, ignore the individuals*/ { - iostats_submit (name, /* vpn instance */ - fields[0], /* "Common Name" */ - atoll (fields[2]), /* "Bytes Received" */ - atoll (fields[3])); /* "Bytes Sent" */ + sum_users += 1; } - else + if (collect_individual_users) { - iostats_submit (fields[0], /* "Common Name" */ - NULL, /* unused when in multimode */ - atoll (fields[2]), /* "Bytes Received" */ - atoll (fields[3])); /* "Bytes Sent" */ + if (new_naming_schema) + { - iostats_submit (fields[0], /* "Common Name" */ - NULL, /* unused when in multimode */ ++ iostats_submit (name, /* vpn instance */ ++ fields[0], /* "Common Name" */ + atoll (fields[2]), /* "Bytes Received" */ + atoll (fields[3])); /* "Bytes Sent" */ + } + else + { - iostats_submit (name, /* vpn instance */ - fields[0], /* "Common Name" */ ++ iostats_submit (fields[0], /* "Common Name" */ ++ NULL, /* unused when in multimode */ + atoll (fields[2]), /* "Bytes Received" */ + atoll (fields[3])); /* "Bytes Sent" */ + } } read = 1;