aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMamatha Inamdar <mamatha4@linux.vnet.ibm.com>2022-05-18 11:47:31 +0530
committerJake Hunsaker <jhunsake@redhat.com>2022-05-23 14:54:51 -0400
commit7713506e112ac5fef9986e3c0be69111729a3384 (patch)
tree38ca8dc86e851ffbebe6b36422c1bb9d3080efe4
parentbf9462a5361991fb6d28471a049123f7b8e15093 (diff)
downloadsos-7713506e112ac5fef9986e3c0be69111729a3384.tar.gz
[fibrchannel]: Update fibrechannel plugin to collect HBA logs
This patch is to update fibrechannel plugin to collect HBA device logs following commands are added hbacmd listhbas hbacmd HbaAttributes <WWPN | MAC> hbacmd PortAttributes <WWPN | MAC> hbacmd ServerAttributes Signed-off-by: Mamatha Inamdar <mamatha4@linux.vnet.ibm.com> Reported-by: Borislav Stoymirski <borislav.stoymirski@bg.ibm.com> Reported-by: Toni Gibson <cajun1@us.ibm.com> Tested-by: Borislav Stoymirski <borislav.stoymirski@bg.ibm.com>
-rw-r--r--sos/report/plugins/fibrechannel.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/sos/report/plugins/fibrechannel.py b/sos/report/plugins/fibrechannel.py
index 4e24d0d8..cd21d5da 100644
--- a/sos/report/plugins/fibrechannel.py
+++ b/sos/report/plugins/fibrechannel.py
@@ -33,4 +33,20 @@ class Fibrechannel(Plugin, RedHatPlugin):
if self.get_option('debug'):
self.add_copy_spec(self.debug_paths)
+ self.add_cmd_output([
+ "hbacmd listhbas",
+ "hbacmd ServerAttributes"
+ ])
+
+ # collect Hbaattributes and Portattributes of WWN
+ listhbas = self.collect_cmd_output("hbacmd listhbas")
+ if listhbas['status'] == 0:
+ for line in listhbas['output'].splitlines():
+ if 'Port WWN' in line:
+ dev = line.split()[3]
+ self.add_cmd_output([
+ "hbacmd HbaAttributes %s" % dev,
+ "hbacmd PortAttributes %s" % dev,
+ "hbacmd GetXcvrData %s" % dev
+ ])
# vim: set et ts=4 sw=4 :