diff options
author | KyleMahlkuch <Kyle.Mahlkuch@ibm.com> | 2017-07-05 10:56:15 -0500 |
---|---|---|
committer | Bryn M. Reeves <bmr@redhat.com> | 2017-08-31 17:37:00 +0100 |
commit | 9ba2ec0ad0853531495e5cba7054741c2b4d5e50 (patch) | |
tree | 047052ee3e8dae206eda0e214c5e44267113ba87 | |
parent | 45d55b34a20b6f36788289e2ebfb33943aa2c3a4 (diff) | |
download | sos-9ba2ec0ad0853531495e5cba7054741c2b4d5e50.tar.gz |
[sas3ircu] add a plugin for sas3ircu
This is a new plugin used to collect data for SAS adapters.
It collects a list of adapters and then puts information on
each adapter into the sosreport.
Signed-off-by: Kyle Mahlkuch <Kyle.Mahlkuch@ibm.com>
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r-- | sos/plugins/sas3ircu.py | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/sos/plugins/sas3ircu.py b/sos/plugins/sas3ircu.py new file mode 100644 index 00000000..f20af13c --- /dev/null +++ b/sos/plugins/sas3ircu.py @@ -0,0 +1,44 @@ +# 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 sosreport plugin is meant for sas adapters. +# This plugin logs inforamtion on each adapter it finds. + +from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin + + +class SAS3ircu(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): + + plugin_name = "sas3ircu" + commands = ("sas3ircu",) + + def setup(self): + + # get list of adapters + result = self.call_ext_prog("sas3ircu list", timeout=5) + + if (result["status"] == 0): + self.add_cmd_output("sas3ircu list", timeout=5) + + # only want devices + sas_lst = result["output"].splitlines()[10:-1] + + # for each adapter get some basic info + for sas_info in sas_lst: + sas_num = sas_info.split()[0] + self.add_cmd_output("sas3ircu %s display" % sas_num, timeout=5) + self.add_cmd_output("sas3ircu %s status" % sas_num, timeout=5) + +# vim: et ts=4 sw=4 |