]> git.ipfire.org Git - thirdparty/collectd.git/commitdiff
virt plugin: Rename the "libvirt" plugin to "virt".
authorFlorian Forster <octo@collectd.org>
Tue, 16 Sep 2014 09:17:55 +0000 (11:17 +0200)
committerFlorian Forster <octo@collectd.org>
Tue, 16 Sep 2014 09:17:55 +0000 (11:17 +0200)
"libvirt" confused libtool and caused problems when re-building from source.

configure.ac
src/Makefile.am
src/collectd.conf.in
src/collectd.conf.pod
src/configfile.c
src/virt.c [moved from src/libvirt.c with 99% similarity]

index bee5f72adfb89edf02b86c33dd783d4af68e6040..bcd8b6021b677ce0d14ff7efafe7f31476a2f532 100644 (file)
@@ -4972,7 +4972,6 @@ plugin_interface="no"
 plugin_ipmi="no"
 plugin_ipvs="no"
 plugin_irq="no"
-plugin_libvirt="no"
 plugin_load="no"
 plugin_log_logstash="no"
 plugin_memory="no"
@@ -4988,8 +4987,9 @@ plugin_tape="no"
 plugin_tcpconns="no"
 plugin_ted="no"
 plugin_thermal="no"
-plugin_users="no"
 plugin_uptime="no"
+plugin_users="no"
+plugin_virt="no"
 plugin_vmem="no"
 plugin_vserver="no"
 plugin_wireless="no"
@@ -5214,11 +5214,6 @@ then
        plugin_interface="yes"
 fi
 
-if test "x$with_libxml2" = "xyes" && test "x$with_libvirt" = "xyes"
-then
-       plugin_libvirt="yes"
-fi
-
 if test "x$have_getloadavg" = "xyes"
 then
        plugin_load="yes"
@@ -5283,6 +5278,12 @@ then
        plugin_users="yes"
 fi
 
+if test "x$with_libxml2" = "xyes" && test "x$with_libvirt" = "xyes"
+then
+       plugin_virt="yes"
+fi
+
+
 m4_divert_once([HELP_ENABLE], [
 collectd plugins:])
 
@@ -5341,7 +5342,6 @@ AC_PLUGIN([iptables],    [$with_libiptc],      [IPTables rule counters])
 AC_PLUGIN([ipvs],        [$plugin_ipvs],       [IPVS connection statistics])
 AC_PLUGIN([irq],         [$plugin_irq],        [IRQ statistics])
 AC_PLUGIN([java],        [$with_java],         [Embed the Java Virtual Machine])
-AC_PLUGIN([libvirt],     [$plugin_libvirt],    [Virtual machine statistics])
 AC_PLUGIN([load],        [$plugin_load],       [System load])
 AC_PLUGIN([logfile],     [yes],                [File logging plugin])
 AC_PLUGIN([log_logstash], [$plugin_log_logstash], [Logstash json_event compatible logging])
@@ -5417,6 +5417,7 @@ AC_PLUGIN([uptime],      [$plugin_uptime],     [Uptime statistics])
 AC_PLUGIN([users],       [$plugin_users],      [User statistics])
 AC_PLUGIN([uuid],        [yes],                [UUID as hostname plugin])
 AC_PLUGIN([varnish],     [$with_libvarnish],   [Varnish cache statistics])
+AC_PLUGIN([virt],        [$plugin_virt],       [Virtual machine statistics])
 AC_PLUGIN([vmem],        [$plugin_vmem],       [Virtual memory statistics])
 AC_PLUGIN([vserver],     [$plugin_vserver],    [Linux VServer statistics])
 AC_PLUGIN([wireless],    [$plugin_wireless],   [Wireless statistics])
@@ -5706,7 +5707,6 @@ Configuration:
     ipvs  . . . . . . . . $enable_ipvs
     irq . . . . . . . . . $enable_irq
     java  . . . . . . . . $enable_java
-    libvirt . . . . . . . $enable_libvirt
     load  . . . . . . . . $enable_load
     logfile . . . . . . . $enable_logfile
     lpar  . . . . . . . . $enable_lpar
@@ -5781,6 +5781,7 @@ Configuration:
     users . . . . . . . . $enable_users
     uuid  . . . . . . . . $enable_uuid
     varnish . . . . . . . $enable_varnish
+    virt  . . . . . . . . $enable_virt
     vmem  . . . . . . . . $enable_vmem
     vserver . . . . . . . $enable_vserver
     wireless  . . . . . . $enable_wireless
index b8623653118416a5790f9b1fd1096d4747e85f5d..340c79289f3f52b9e9e943d5d80aa8b7ed912111 100644 (file)
@@ -566,17 +566,6 @@ collectd_LDADD += "-dlopen" java.la
 collectd_DEPENDENCIES += java.la
 endif
 
-if BUILD_PLUGIN_LIBVIRT
-pkglib_LTLIBRARIES += libvirt.la
-libvirt_la_SOURCES = libvirt.c
-libvirt_la_CFLAGS = $(AM_CFLAGS) \
-               $(BUILD_WITH_LIBVIRT_CFLAGS) $(BUILD_WITH_LIBXML2_CFLAGS)
-libvirt_la_LIBADD = $(BUILD_WITH_LIBVIRT_LIBS) $(BUILD_WITH_LIBXML2_LIBS)
-libvirt_la_LDFLAGS = -module -avoid-version
-collectd_LDADD += "-dlopen" libvirt.la
-collectd_DEPENDENCIES += libvirt.la
-endif
-
 if BUILD_PLUGIN_LOAD
 pkglib_LTLIBRARIES += load.la
 load_la_SOURCES = load.c
@@ -1375,6 +1364,17 @@ collectd_LDADD += "-dlopen" varnish.la
 collectd_DEPENDENCIES += varnish.la
 endif
 
+if BUILD_PLUGIN_VIRT
+pkglib_LTLIBRARIES += virt.la
+virt_la_SOURCES = virt.c
+virt_la_CFLAGS = $(AM_CFLAGS) \
+               $(BUILD_WITH_LIBVIRT_CFLAGS) $(BUILD_WITH_LIBXML2_CFLAGS)
+virt_la_LIBADD = $(BUILD_WITH_LIBVIRT_LIBS) $(BUILD_WITH_LIBXML2_LIBS)
+virt_la_LDFLAGS = -module -avoid-version
+collectd_LDADD += "-dlopen" virt.la
+collectd_DEPENDENCIES += virt.la
+endif
+
 if BUILD_PLUGIN_VMEM
 pkglib_LTLIBRARIES += vmem.la
 vmem_la_SOURCES = vmem.c
index 91c040a3ca67a144ba573c4faaf2d5ef5f926c23..8e1bae7154c79830d9b1ed14f6a23f4d467c2114 100644 (file)
 #@BUILD_PLUGIN_IPVS_TRUE@LoadPlugin ipvs
 #@BUILD_PLUGIN_IRQ_TRUE@LoadPlugin irq
 #@BUILD_PLUGIN_JAVA_TRUE@LoadPlugin java
-#@BUILD_PLUGIN_LIBVIRT_TRUE@LoadPlugin libvirt
 @BUILD_PLUGIN_LOAD_TRUE@@BUILD_PLUGIN_LOAD_TRUE@LoadPlugin load
 #@BUILD_PLUGIN_LPAR_TRUE@LoadPlugin lpar
 #@BUILD_PLUGIN_LVM_TRUE@LoadPlugin lvm
 #@BUILD_PLUGIN_UUID_TRUE@LoadPlugin uuid
 #@BUILD_PLUGIN_VARNISH_TRUE@LoadPlugin varnish
 #@BUILD_PLUGIN_MIC_TRUE@LoadPlugin mic
+#@BUILD_PLUGIN_VIRT_TRUE@LoadPlugin virt
 #@BUILD_PLUGIN_VMEM_TRUE@LoadPlugin vmem
 #@BUILD_PLUGIN_VSERVER_TRUE@LoadPlugin vserver
 #@BUILD_PLUGIN_WIRELESS_TRUE@LoadPlugin wireless
 #      </Plugin>
 #</Plugin>
 
-#<Plugin libvirt>
-#      Connection "xen:///"
-#      RefreshInterval 60
-#      Domain "name"
-#      BlockDevice "name:device"
-#      InterfaceDevice "name:device"
-#      IgnoreSelected false
-#      HostnameFormat name
-#      InterfaceFormat name
-#      PluginInstanceFormat name
-#</Plugin>
-
 #<Plugin load>
 #        ReportRelative true
 #</Plugin>
 #   </Instance>
 #</Plugin>
 
+#<Plugin virt>
+#      Connection "xen:///"
+#      RefreshInterval 60
+#      Domain "name"
+#      BlockDevice "name:device"
+#      InterfaceDevice "name:device"
+#      IgnoreSelected false
+#      HostnameFormat name
+#      InterfaceFormat name
+#      PluginInstanceFormat name
+#</Plugin>
+
 #<Plugin vmem>
 #      Verbose false
 #</Plugin>
index 8ecc92d647ff7a38c5ea9310560d29b05ef9bfb4..939cfdaaa342dbfeaa5b18dddca98509bccb4667 100644 (file)
@@ -860,7 +860,7 @@ and are checked by default depends on the distribution you use.
 
 This plugin reads absolute air pressure using digital barometer sensor MPL115A2
 or MPL3115 from Freescale (sensor attached to any I2C bus available in
-the computer, for HW details see 
+the computer, for HW details see
 I<http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=MPL115A> or
 I<http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=MPL3115A2>).
 The sensor type - one fo these two - is detected automatically by the plugin
@@ -973,7 +973,7 @@ Temperature sensor which should be used as a reference when normalizing the pres
 When specified more sensors a minumum is found and uses each time.
 The temperature reading directly from this pressure sensor/plugin
 is typically not suitable as the pressure sensor
-will be probably inside while we want outside temperature. 
+will be probably inside while we want outside temperature.
 The collectd reference name is something like
 <hostname>/<plugin_name>-<plugin_instance>/<type>-<type_instance>
 (<type_instance> is usually omitted when there is just single value type).
@@ -1786,7 +1786,7 @@ There must be at least one B<ValuesFrom> option inside each B<Result> block.
 =item B<MetadataFrom> [I<column0> I<column1> ...]
 
 Names the columns whose content is used as metadata for the data sets
-that are dispatched to the daemon. 
+that are dispatched to the daemon.
 
 The actual data type in the columns is not that important. The plugin will
 automatically cast the values to the right type if it know how to do that. So
@@ -2430,101 +2430,6 @@ independent from the I<JavaClass> argument passed to B<LoadPlugin>.
 
 =back
 
-=head2 Plugin C<libvirt>
-
-This plugin allows CPU, disk and network load to be collected for virtualized
-guests on the machine. This means that these characteristics can be collected
-for guest systems without installing any software on them - collectd only runs
-on the hosting system. The statistics are collected through libvirt
-(L<http://libvirt.org/>).
-
-Only I<Connection> is required.
-
-=over 4
-
-=item B<Connection> I<uri>
-
-Connect to the hypervisor given by I<uri>. For example if using Xen use:
-
- Connection "xen:///"
-
-Details which URIs allowed are given at L<http://libvirt.org/uri.html>.
-
-=item B<RefreshInterval> I<seconds>
-
-Refresh the list of domains and devices every I<seconds>. The default is 60
-seconds. Setting this to be the same or smaller than the I<Interval> will cause
-the list of domains and devices to be refreshed on every iteration.
-
-Refreshing the devices in particular is quite a costly operation, so if your
-virtualization setup is static you might consider increasing this. If this
-option is set to 0, refreshing is disabled completely.
-
-=item B<Domain> I<name>
-
-=item B<BlockDevice> I<name:dev>
-
-=item B<InterfaceDevice> I<name:dev>
-
-=item B<IgnoreSelected> I<true>|I<false>
-
-Select which domains and devices are collected.
-
-If I<IgnoreSelected> is not given or I<false> then only the listed domains and
-disk/network devices are collected.
-
-If I<IgnoreSelected> is I<true> then the test is reversed and the listed
-domains and disk/network devices are ignored, while the rest are collected.
-
-The domain name and device names may use a regular expression, if the name is
-surrounded by I</.../> and collectd was compiled with support for regexps.
-
-The default is to collect statistics for all domains and all their devices.
-
-Example:
-
- BlockDevice "/:hdb/"
- IgnoreSelected "true"
-
-Ignore all I<hdb> devices on any domain, but other block devices (eg. I<hda>)
-will be collected.
-
-=item B<HostnameFormat> B<name|uuid|hostname|...>
-
-When the libvirt plugin logs data, it sets the hostname 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>.
-
-B<uuid> means use the guest's UUID. This is useful if you want to track the
-same guest across migrations.
-
-B<hostname> means to use the global B<Hostname> setting, which is probably not
-useful on its own because all guests will appear to have the same name.
-
-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">).
-
-=item B<InterfaceFormat> B<name>|B<address>
-
-When the libvirt plugin logs interface data, it sets the name of the collected
-data according to this setting. The default is to use the path as provided by
-the hypervisor (the "dev" property of the target node), which is equal to
-setting B<name>.
-
-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>
-
-When the libvirt 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>.
-
-B<uuid> means use the guest's UUID.
-
-=back
-
 =head2 Plugin C<load>
 
 The I<Load plugin> collects the system load. These numbers give a rough overview
@@ -6504,6 +6409,101 @@ Collect statistics about worker threads. False by default.
 
 =back
 
+=head2 Plugin C<virt>
+
+This plugin allows CPU, disk and network load to be collected for virtualized
+guests on the machine. This means that these metrics can be collected for guest
+systems without installing any software on them - I<collectd> only runs on the
+host system. The statistics are collected through libvirt
+(L<http://libvirt.org/>).
+
+Only I<Connection> is required.
+
+=over 4
+
+=item B<Connection> I<uri>
+
+Connect to the hypervisor given by I<uri>. For example if using Xen use:
+
+ Connection "xen:///"
+
+Details which URIs allowed are given at L<http://libvirt.org/uri.html>.
+
+=item B<RefreshInterval> I<seconds>
+
+Refresh the list of domains and devices every I<seconds>. The default is 60
+seconds. Setting this to be the same or smaller than the I<Interval> will cause
+the list of domains and devices to be refreshed on every iteration.
+
+Refreshing the devices in particular is quite a costly operation, so if your
+virtualization setup is static you might consider increasing this. If this
+option is set to 0, refreshing is disabled completely.
+
+=item B<Domain> I<name>
+
+=item B<BlockDevice> I<name:dev>
+
+=item B<InterfaceDevice> I<name:dev>
+
+=item B<IgnoreSelected> B<true>|B<false>
+
+Select which domains and devices are collected.
+
+If I<IgnoreSelected> is not given or B<false> then only the listed domains and
+disk/network devices are collected.
+
+If I<IgnoreSelected> is B<true> then the test is reversed and the listed
+domains and disk/network devices are ignored, while the rest are collected.
+
+The domain name and device names may use a regular expression, if the name is
+surrounded by I</.../> and collectd was compiled with support for regexps.
+
+The default is to collect statistics for all domains and all their devices.
+
+Example:
+
+ BlockDevice "/:hdb/"
+ IgnoreSelected "true"
+
+Ignore all I<hdb> devices on any domain, but other block devices (eg. I<hda>)
+will be collected.
+
+=item B<HostnameFormat> B<name|uuid|hostname|...>
+
+When the libvirt plugin logs data, it sets the hostname 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>.
+
+B<uuid> means use the guest's UUID. This is useful if you want to track the
+same guest across migrations.
+
+B<hostname> means to use the global B<Hostname> setting, which is probably not
+useful on its own because all guests will appear to have the same name.
+
+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">).
+
+=item B<InterfaceFormat> B<name>|B<address>
+
+When the libvirt plugin logs interface data, it sets the name of the collected
+data according to this setting. The default is to use the path as provided by
+the hypervisor (the "dev" property of the target node), which is equal to
+setting B<name>.
+
+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>
+
+When the libvirt 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>.
+
+B<uuid> means use the guest's UUID.
+
+=back
+
 =head2 Plugin C<vmem>
 
 The C<vmem> plugin collects information about the usage of virtual memory.
index fbb3cd3362f55a5e98b7e071074eb7893d8d6399..02fd96f6fc2a09c2dd32dca7ca7a65c1c059f068 100644 (file)
@@ -281,6 +281,8 @@ static int dispatch_loadplugin (const oconfig_item_t *ci)
                return (-1);
 
        name = ci->values[0].value.string;
+       if (strcmp ("libvirt", name) == 0)
+               name = "virt";
 
        /* default to the global interval set before loading this plugin */
        memset (&ctx, 0, sizeof (ctx));
@@ -383,6 +385,15 @@ static int dispatch_block_plugin (oconfig_item_t *ci)
                return (-1);
 
        name = ci->values[0].value.string;
+       if (strcmp ("libvirt", name) == 0)
+       {
+               /* TODO(octo): Remove this legacy. */
+               WARNING ("The \"libvirt\" plugin has been renamed to \"virt\" to avoid problems with the build system. "
+                               "Your configuration is still using the old name. "
+                               "Please change it to use \"virt\" as soon as possible. "
+                               "This compatibility code will go away eventually.");
+               name = "virt";
+       }
 
        if (IS_TRUE (global_option_get ("AutoLoadPlugin")))
        {
similarity index 99%
rename from src/libvirt.c
rename to src/virt.c
index b0c694a3739106ec6c7a75b69fff1afcfdcc1f0f..6118c0fdabddc541214294e9390f7d7112516e49 100644 (file)
@@ -1,5 +1,5 @@
 /**
- * collectd - src/libvirt.c
+ * collectd - src/virt.c
  * Copyright (C) 2006-2008  Red Hat Inc.
  *
  * This program is free software; you can redistribute it and/or modify it
@@ -33,7 +33,7 @@
 #include <libxml/xpath.h>
 
 /* Plugin name */
-#define PLUGIN_NAME "libvirt"
+#define PLUGIN_NAME "virt"
 
 static const char *config_keys[] = {
     "Connection",
@@ -574,14 +574,14 @@ lv_read (void)
 
         minfo = malloc (VIR_DOMAIN_MEMORY_STAT_NR * sizeof (virDomainMemoryStatStruct));
         if (minfo == NULL) {
-            ERROR ("libvirt plugin: malloc failed.");
+            ERROR ("virt plugin: malloc failed.");
             continue;
         }
 
         status =  virDomainMemoryStats (domains[i], minfo, VIR_DOMAIN_MEMORY_STAT_NR, 0);
 
         if (status < 0) {
-            ERROR ("libvirt plugin: virDomainMemoryStats failed with status %i.",
+            ERROR ("virt plugin: virDomainMemoryStats failed with status %i.",
                     status);
             sfree (minfo);
             continue;