From 25a4bb8814ececaaec55601ae30c2fc0fffcc144 Mon Sep 17 00:00:00 2001 From: Chad Malfait Date: Sat, 13 Apr 2013 13:34:38 -0600 Subject: [PATCH] Changed plugin from volume to lvm Signed-off-by: Florian Forster --- configure.in | 6 +++--- src/Makefile.am | 18 +++++++++--------- src/collectd.conf.in | 2 +- src/{volume.c => lvm.c} | 10 +++++----- 4 files changed, 18 insertions(+), 18 deletions(-) rename src/{volume.c => lvm.c} (90%) diff --git a/configure.in b/configure.in index 0fb20c6c..fb71e6f2 100644 --- a/configure.in +++ b/configure.in @@ -4682,6 +4682,7 @@ then plugin_interface="yes" plugin_irq="yes" plugin_load="yes" + plugin_lvm="yes" plugin_memory="yes" plugin_nfs="yes" plugin_numa="yes" @@ -4693,7 +4694,6 @@ then plugin_thermal="yes" plugin_uptime="yes" plugin_vmem="yes" - plugin_volume="yes" plugin_vserver="yes" plugin_wireless="yes" @@ -4979,6 +4979,7 @@ AC_PLUGIN([libvirt], [$plugin_libvirt], [Virtual machine statistics]) AC_PLUGIN([load], [$plugin_load], [System load]) AC_PLUGIN([logfile], [yes], [File logging plugin]) AC_PLUGIN([lpar], [$with_perfstat], [AIX logical partitions statistics]) +AC_PLUGIN([lvm], [$with_liblvm2app], [LVM statistics]) AC_PLUGIN([madwifi], [$have_linux_wireless_h], [Madwifi wireless statistics]) AC_PLUGIN([match_empty_counter], [yes], [The empty counter match]) AC_PLUGIN([match_hashed], [yes], [The hashed match]) @@ -5047,7 +5048,6 @@ 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([vmem], [$plugin_vmem], [Virtual memory statistics]) -AC_PLUGIN([volume], [$with_liblvm2app], [Volume statistics]) AC_PLUGIN([vserver], [$plugin_vserver], [Linux VServer statistics]) AC_PLUGIN([wireless], [$plugin_wireless], [Wireless statistics]) AC_PLUGIN([write_graphite], [yes], [Graphite / Carbon output plugin]) @@ -5316,6 +5316,7 @@ Configuration: load . . . . . . . . $enable_load logfile . . . . . . . $enable_logfile lpar... . . . . . . . $enable_lpar + lvm . . . . . . . . . $enable_lvm madwifi . . . . . . . $enable_madwifi match_empty_counter . $enable_match_empty_counter match_hashed . . . . $enable_match_hashed @@ -5383,7 +5384,6 @@ Configuration: uuid . . . . . . . . $enable_uuid varnish . . . . . . . $enable_varnish vmem . . . . . . . . $enable_vmem - volume . . . . . . . $enable_volume vserver . . . . . . . $enable_vserver wireless . . . . . . $enable_wireless write_graphite . . . $enable_write_graphite diff --git a/src/Makefile.am b/src/Makefile.am index 4ffb8b01..8dfdebed 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -568,6 +568,15 @@ collectd_DEPENDENCIES += lpar.la lpar_la_LIBADD = -lperfstat endif +if BUILD_PLUGIN_LVM +pkglib_LTLIBRARIES += lvm.la +lvm_la_SOURCES = lvm.c +lvm_la_LDFLAGS = -module -avoid-version +lvm_la_LIBADD = $(BUILD_WITH_LIBLVM2APP_LIBS) +collectd_LDADD += "-dlopen" lvm.la +collectd_DEPENDENCIES += lvm.la +endif + if BUILD_PLUGIN_MADWIFI pkglib_LTLIBRARIES += madwifi.la madwifi_la_SOURCES = madwifi.c madwifi.h @@ -1290,15 +1299,6 @@ collectd_LDADD += "-dlopen" vmem.la collectd_DEPENDENCIES += vmem.la endif -if BUILD_PLUGIN_VOLUME -pkglib_LTLIBRARIES += volume.la -volume_la_SOURCES = volume.c -volume_la_LDFLAGS = -module -avoid-version -volume_la_LIBADD = $(BUILD_WITH_LIBLVM2APP_LIBS) -collectd_LDADD += "-dlopen" volume.la -collectd_DEPENDENCIES += volume.la -endif - if BUILD_PLUGIN_VSERVER pkglib_LTLIBRARIES += vserver.la vserver_la_SOURCES = vserver.c diff --git a/src/collectd.conf.in b/src/collectd.conf.in index ecc45c9a..e95fae6a 100644 --- a/src/collectd.conf.in +++ b/src/collectd.conf.in @@ -99,6 +99,7 @@ #@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_MADWIFI_TRUE@LoadPlugin madwifi #@BUILD_PLUGIN_MBMON_TRUE@LoadPlugin mbmon #@BUILD_PLUGIN_MD_TRUE@LoadPlugin md @@ -158,7 +159,6 @@ #@BUILD_PLUGIN_VARNISH_TRUE@LoadPlugin varnish #@BUILD_PLUGIN_VMEM_TRUE@LoadPlugin vmem #@BUILD_PLUGIN_VSERVER_TRUE@LoadPlugin vserver -#@BUILD_PLUGIN_VOLUME_TRUE@LoadPlugin volume #@BUILD_PLUGIN_WIRELESS_TRUE@LoadPlugin wireless #@BUILD_PLUGIN_WRITE_GRAPHITE_TRUE@LoadPlugin write_graphite #@BUILD_PLUGIN_WRITE_HTTP_TRUE@LoadPlugin write_http diff --git a/src/volume.c b/src/lvm.c similarity index 90% rename from src/volume.c rename to src/lvm.c index 009f4429..6ef3a7b2 100644 --- a/src/volume.c +++ b/src/lvm.c @@ -1,5 +1,5 @@ /** - * collectd - src/volume.c + * collectd - src/lvm.c * Copyright (C) 2013 Chad Malfait * * This program is free software; you can redistribute it and/or modify it @@ -68,13 +68,13 @@ static int lvm_read(void) lvm = lvm_init(NULL); if (!lvm) { - ERROR("volume plugin: lvm_init failed."); + ERROR("lvm plugin: lvm_init failed."); return (-1); } vg_names = lvm_list_vg_names(lvm); if (!vg_names) { - ERROR("volume plugin lvm_list_vg_name failed %s", lvm_errmsg(lvm)); + ERROR("lvm plugin lvm_list_vg_name failed %s", lvm_errmsg(lvm)); lvm_quit(lvm); return (-1); } @@ -84,7 +84,7 @@ static int lvm_read(void) vg = lvm_vg_open(lvm, name_list->str, "r", 0); if (!vg) { - ERROR ("volume plugin: lvm_vg_open (%s) failed: %s", + ERROR ("lvm plugin: lvm_vg_open (%s) failed: %s", name_list->str, lvm_errmsg(lvm)); continue; } @@ -99,5 +99,5 @@ static int lvm_read(void) void module_register(void) { - plugin_register_read("volume", lvm_read); + plugin_register_read("lvm", lvm_read); } /* void module_register */ -- 2.11.0