diff options
author | Pavel Moravec <pmoravec@redhat.com> | 2017-02-19 13:39:00 +0100 |
---|---|---|
committer | Bryn M. Reeves <bmr@redhat.com> | 2017-02-21 12:20:29 +0000 |
commit | 2523ad5013f36bf673b178850d6811151d6ccca3 (patch) | |
tree | 8c3fc9a9dfb1a62c0130005b4366284241da9291 | |
parent | 701522333f3ccae8d04f698186597a418d15e8e9 (diff) | |
download | sos-2523ad5013f36bf673b178850d6811151d6ccca3.tar.gz |
[libvirt] collect more info for KVM hosts
Collect whole /var/run/libvirt, excluding some secrets.
For PIDs in libvirt PID files, collect some /proc/$PID/ info.
Resolves: #937
Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
-rw-r--r-- | sos/plugins/libvirt.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sos/plugins/libvirt.py b/sos/plugins/libvirt.py index 295c8ebc..eb444f3b 100644 --- a/sos/plugins/libvirt.py +++ b/sos/plugins/libvirt.py @@ -31,13 +31,16 @@ class Libvirt(Plugin, RedHatPlugin, UbuntuPlugin, DebianPlugin): self.add_forbidden_path("/etc/libvirt/passwd.db") self.add_forbidden_path("/etc/libvirt/krb5.tab") + self.add_forbidden_path("/var/lib/libvirt/qemu/*/master-key.aes") + self.add_forbidden_path("/etc/libvirt/secrets") + self.add_copy_spec([ "/etc/libvirt/libvirt.conf", "/etc/libvirt/libvirtd.conf", "/etc/libvirt/lxc.conf", "/etc/libvirt/nwfilter/*.xml", "/etc/libvirt/qemu/*.xml", - "/var/run/libvirt/qemu/*.xml", + "/var/run/libvirt/", "/etc/libvirt/qemu/networks/*.xml", "/etc/libvirt/qemu/networks/autostart/*.xml", "/etc/libvirt/storage/*.xml", @@ -61,6 +64,12 @@ class Libvirt(Plugin, RedHatPlugin, UbuntuPlugin, DebianPlugin): self.add_cmd_output("ls -lR /var/lib/libvirt/qemu") + # get details of processes of KVM hosts + for pidfile in glob.glob("/var/run/libvirt/*/*.pid"): + pid = open(pidfile).read().splitlines()[0] + for pf in ["environ", "cgroups", "maps", "numa_maps", "limits"]: + self.add_copy_spec("/proc/%s/%s" % (pid, pf)) + def postproc(self): for loc in ["/etc/", "/var/run/"]: for xmlfile in glob.glob(loc + "libvirt/qemu/*.xml"): |