From 45954d982ea447f4cff74e88f8e50b53e8848c0d Mon Sep 17 00:00:00 2001 From: "Bryn M. Reeves" Date: Thu, 18 Sep 2014 21:37:43 +0100 Subject: [emc,powerpath] move PowerPath collection into its own plugin Move PowerPath functionality into a new powerpath plugin and remove the (now empty) EMC plugin. Fixes: #257. Signed-off-by: Bryn M. Reeves --- sos/plugins/emc.py | 113 ----------------------------------------------- sos/plugins/powerpath.py | 63 ++++++++++++++++++++++++++ 2 files changed, 63 insertions(+), 113 deletions(-) delete mode 100644 sos/plugins/emc.py create mode 100644 sos/plugins/powerpath.py diff --git a/sos/plugins/emc.py b/sos/plugins/emc.py deleted file mode 100644 index 5757c8f7..00000000 --- a/sos/plugins/emc.py +++ /dev/null @@ -1,113 +0,0 @@ -# Copyright (C) 2008 EMC Corporation. Keith Kearnan - -# 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 - -# 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. - -""" Captures EMC specific information during a sos run. """ - -from sos.plugins import Plugin, RedHatPlugin, os - -# Just for completeness sake. -from six.moves import input - - -class Emc(Plugin, RedHatPlugin): - """ EMC related information - """ - - plugin_name = 'emc' - profiles = ('storage', 'hardware') - - def about_emc(self): - """ EMC Corporation specific information - """ - self.add_custom_text( - '

' - 'EMC²®') - self.add_custom_text( - '
where information lives' - '®

') - self.add_custom_text( - "EMC Corporation is the world's leading developer and provider " - "of information ") - self.add_custom_text( - "infrastructure technology and solutions that " - "enable organizations of all sizes to transform ") - self.add_custom_text( - "the way they compete and create value from their " - "information.  ") - self.add_custom_text( - "Information about EMC's products and services " - "can be found at ") - self.add_custom_text( - 'www.EMC.com.
') - - def get_pp_files(self): - """ EMC PowerPath specific information - files - """ - self.add_cmd_output("powermt version") - self.add_copy_specs([ - "/etc/init.d/PowerPath", - "/etc/powermt.custom", - "/etc/emcp_registration", - "/etc/emc/mpaa.excluded", - "/etc/emc/mpaa.lams", - "/etc/emcp_devicesDB.dat", - "/etc/emcp_devicesDB.idx", - "/etc/emc/powerkmd.custom", - "/etc/modprobe.conf.pp" - ]) - - def get_pp_config(self): - """ EMC PowerPath specific information - commands - """ - self.add_cmd_outputs([ - "powermt display", - "powermt display dev=all", - "powermt check_registration", - "powermt display options", - "powermt display ports", - "powermt display paths", - "powermt dump" - ]) - - def check_enabled(self): - self.packages = ["EMCpower"] - self.files = ["/opt/Navisphere/bin", "/proc/emcp"] - return Plugin.check_enabled(self) - - def setup(self): - from subprocess import Popen, PIPE - # About EMC Corporation default no if no EMC products are installed - add_about_emc = "no" - - # If PowerPath is installed collect PowerPath specific information - if self.is_installed("EMCpower"): - print("EMC PowerPath is installed.") - print(" Gathering EMC PowerPath information...") - self.add_custom_text("EMC PowerPath is installed.
") - self.get_pp_files() - add_about_emc = "yes" - - # If PowerPath is running collect additional PowerPath specific - # information - if os.path.isdir("/proc/emcp"): - print("EMC PowerPath is running.") - print(" Gathering additional EMC PowerPath information...") - self.get_pp_config() - - # Only provide About EMC if EMC products are installed - if add_about_emc != "no": - self.about_emc() - -# vim: et ts=4 sw=4 diff --git a/sos/plugins/powerpath.py b/sos/plugins/powerpath.py new file mode 100644 index 00000000..990cfab5 --- /dev/null +++ b/sos/plugins/powerpath.py @@ -0,0 +1,63 @@ +# Copyright (C) 2008 EMC Corporation. Keith Kearnan + +# 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 + +# 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. + +from sos.plugins import Plugin, RedHatPlugin, os + + +class PowerPath(Plugin, RedHatPlugin): + """ EMC PowerPath + """ + + plugin_name = 'powerpath' + profiles = ('storage', 'hardware') + packages = ('EMCpower',) + + def get_pp_files(self): + """ EMC PowerPath specific information - files + """ + self.add_cmd_output("powermt version") + self.add_copy_specs([ + "/etc/init.d/PowerPath", + "/etc/powermt.custom", + "/etc/emcp_registration", + "/etc/emc/mpaa.excluded", + "/etc/emc/mpaa.lams", + "/etc/emcp_devicesDB.dat", + "/etc/emcp_devicesDB.idx", + "/etc/emc/powerkmd.custom", + "/etc/modprobe.conf.pp" + ]) + + def get_pp_config(self): + """ EMC PowerPath specific information - commands + """ + self.add_cmd_outputs([ + "powermt display", + "powermt display dev=all", + "powermt check_registration", + "powermt display options", + "powermt display ports", + "powermt display paths", + "powermt dump" + ]) + + def setup(self): + self.get_pp_files() + # If PowerPath is running collect additional PowerPath specific + # information + if os.path.isdir("/proc/emcp"): + self.get_pp_config() + +# vim: et ts=4 sw=4 -- cgit