aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryn M. Reeves <bmr@redhat.com>2013-10-30 13:57:22 +0000
committerBryn M. Reeves <bmr@redhat.com>2013-10-30 13:57:22 +0000
commit9d7c1dede6c23ce86a07ffb0c1a83c4d285e680c (patch)
treecd0d1ee9ee10cfe712a332835bd4073a7899b8c0
parentd1bedc1ef48f6abe6f582336e275468a1e3634b9 (diff)
downloadsos-9d7c1dede6c23ce86a07ffb0c1a83c4d285e680c.tar.gz
This patch defines a new PowerPC Plugin to collect generic Power logs.
Based on further platform checks,IBM Power System specific logs and commands will be collected. This would help IBM Power system users to collect system data in one shot by running sosreport. Signed-off-by: Bharani C.V. <bharanve@linux.vnet.ibm.com> Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Bryn M. Reeves <bmr@redhat.com> --- sos/plugins/powerpc.py | 73 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 sos/plugins/powerpc.py
-rw-r--r--sos/plugins/powerpc.py73
1 files changed, 73 insertions, 0 deletions
diff --git a/sos/plugins/powerpc.py b/sos/plugins/powerpc.py
new file mode 100644
index 00000000..974baa16
--- /dev/null
+++ b/sos/plugins/powerpc.py
@@ -0,0 +1,73 @@
+### This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License for more details.
+
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+## This plugin enables collection of logs for Power systems and more
+## specific logs for Pseries, PowerNV platforms.
+
+import os
+from sos.plugins import Plugin, RedHatPlugin, UbuntuPlugin, DebianPlugin
+
+class PowerPC(Plugin, RedHatPlugin, UbuntuPlugin, DebianPlugin):
+ """IBM Power System related information
+ """
+
+ plugin_name = 'powerpc'
+
+ def check_enabled(self):
+ return (self.policy().get_arch() == "ppc64")
+
+ def setup(self):
+ try:
+ with open('/proc/cpuinfo', 'r') as fp:
+ contents = fp.read()
+ ispSeries = "pSeries" in contents
+ isPowerNV = "PowerNV" in contents
+ except:
+ ispSeries = False
+ isPowerNV = False
+
+ if ispSeries or isPowerNV:
+ self.add_copy_spec("/proc/device-tree/")
+ self.add_copy_spec("/proc/loadavg")
+ self.add_copy_spec("/proc/locks")
+ self.add_copy_spec("/proc/misc")
+ self.add_copy_spec("/proc/swaps")
+ self.add_copy_spec("/proc/version")
+ self.add_copy_spec("/dev/nvram")
+ self.add_copy_spec("/var/log/platform")
+ self.add_cmd_output("ppc64_cpu --smt")
+ self.add_cmd_output("ppc64_cpu --cores-present")
+ self.add_cmd_output("ppc64_cpu --cores-on")
+ self.add_cmd_output("ppc64_cpu --run-mode")
+ self.add_cmd_output("ppc64_cpu --frequency")
+ self.add_cmd_output("ppc64_cpu --dscr")
+
+ if ispSeries:
+ self.add_copy_spec("/proc/ppc64/lparcfg")
+ self.add_copy_spec("/proc/ppc64/eeh")
+ self.add_copy_spec("/proc/ppc64/systemcfg")
+ self.add_cmd_output("lscfg -vp")
+ self.add_cmd_output("lsmcode -A")
+ self.add_cmd_output("lsvpd --debug")
+ self.add_cmd_output("lsvio -des")
+ self.add_cmd_output("servicelog --dump")
+ self.add_cmd_output("servicelog_notify --list")
+ self.add_cmd_output("usysattn")
+ self.add_cmd_output("usysident")
+ self.add_cmd_output("serv_config -l")
+ self.add_cmd_output("bootlist -m both -r")
+ self.add_cmd_output("lparstat -i")
+
+ if isPowerNV:
+ self.add_copy_spec("/proc/ppc64/")