From 29f388bf5bf0153b7d5e00ae0e0d6b48c27176e2 Mon Sep 17 00:00:00 2001 From: Jose Castillo Date: Fri, 1 Aug 2014 11:05:23 +0200 Subject: [lvm2] Extend reporting fields for pvs, vgs and lvs. There were some useful columns missing from the output of the commands 'pvs', 'vgs' and 'lvs' that we gather in the lvm plugin. This patch extends the reporting fields with: - Information about metadata, like copies and size of mda, to the output of the 'pvs' command. - Information about metadata and tags for the output of the 'vgs' command, and - information about tags for the output of 'lvs'. Attempts to solve at least partially issue #331. Signed-off-by: Jose Castillo Signed-off-by: Bryn M. Reeves (Minor pep8 fixups.) --- sos/plugins/lvm2.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/sos/plugins/lvm2.py b/sos/plugins/lvm2.py index 60f4bbc7..ab6f0a7a 100644 --- a/sos/plugins/lvm2.py +++ b/sos/plugins/lvm2.py @@ -52,12 +52,17 @@ class Lvm2(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): "vgdisplay -vv %s" % lvm_opts, root_symlink="vgdisplay" ) + + pvs_cols = 'pv_mda_free,pv_mda_size,pv_mda_count,pv_mda_used_count' + vgs_cols = 'vg_mda_count,vg_mda_free,vg_mda_size,vg_mda_used_count' + vgs_cols = vgs_cols + ',' + 'vg_tags' + lvs_cols = 'lv_tags,devices' self.add_cmd_outputs([ "vgscan -vvv %s" % lvm_opts, "pvscan -v %s" % lvm_opts, - "pvs -a -v %s" % lvm_opts, - "vgs -v %s" % lvm_opts, - "lvs -a -o +devices %s" % lvm_opts + "pvs -a -v -o +%s %s" % (pvs_cols, lvm_opts), + "vgs -v -o +%s %s" % (vgs_cols, lvm_opts), + "lvs -a -o +%s %s" % (lvs_cols, lvm_opts) ]) self.add_copy_spec("/etc/lvm") -- cgit