summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1551022)
raw | patch | inline | side by side (parent: 1551022)
author | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Tue, 30 Jun 2015 13:04:11 +0000 (15:04 +0200) | ||
committer | Marc Fournier <marc.fournier@camptocamp.com> | |
Fri, 11 Sep 2015 21:29:20 +0000 (23:29 +0200) |
Fixes #1100
src/collectd.conf.pod | patch | blob | history | |
src/virt.c | patch | blob | history |
diff --git a/src/collectd.conf.pod b/src/collectd.conf.pod
index d20feae8e4d690d87645f96357dc850e6252a21c..59247da02b8c11b2725b8244706abeaa8e779784 100644 (file)
--- a/src/collectd.conf.pod
+++ b/src/collectd.conf.pod
B<address> means use the interface's mac address. This is useful since the
interface path might change between reboots of a guest or across migrations.
-=item B<PluginInstanceFormat> B<name|uuid>
+=item B<PluginInstanceFormat> B<name|uuid|none>
When the virt plugin logs data, it sets the plugin_instance of the collected
-data according to this setting. The default is to use the guest name as provided
-by the hypervisor, which is equal to setting B<name>.
+data according to this setting. The default is to not set the plugin_instance.
+B<name> means use the guest's name as provided by the hypervisor.
B<uuid> means use the guest's UUID.
-You can also specify combinations of these fields. For example B<name uuid>
-means to concatenate the guest name and UUID (with a literal colon character
-between, thus I<"foo:1234-1234-1234-1234">).
+You can also specify combinations of the B<name> and B<uuid> fields.
+For example B<name uuid> means to concatenate the guest name and UUID
+(with a literal colon character between, thus I<"foo:1234-1234-1234-1234">).
=back
diff --git a/src/virt.c b/src/virt.c
index 663555b9bd33a2375d717482987041824a3f5c76..6824b134aeed727de314b5006fee3f14477ae6f5 100644 (file)
--- a/src/virt.c
+++ b/src/virt.c
};
static enum plginst_field plugin_instance_format[PLGINST_MAX_FIELDS] =
- { plginst_name };
+ { plginst_none };
/* InterfaceFormat. */
enum if_field {
}
for (i = 0; i < n; ++i) {
- if (strcasecmp (fields[i], "name") == 0)
+ if (strcasecmp (fields[i], "none") == 0) {
+ plugin_instance_format[i] = plginst_none;
+ break;
+ } else if (strcasecmp (fields[i], "name") == 0)
plugin_instance_format[i] = plginst_name;
else if (strcasecmp (fields[i], "uuid") == 0)
plugin_instance_format[i] = plginst_uuid;