
    -_g
                     8    d dl Z d dlmZmZmZ  G d dee      Zy)    N)PluginIndependentPlugin	PluginOptc                   D    e Zd ZdZdZdZdZdZ eddd	      gZ	d
 Z
d Zy)HpssmaG  
    This plugin will capture details for each controller from Smart Storage
    Array Administrator, an Array diagnostic report from Smart Storage
    Administrator Diagnostics Utility and, when the plugins debug option is
    enabled will gather the Active Health System log via the RESTful Interface
    Tool (iLOREST).
    zHP Smart Storage Managementhpssm)systemstoragehardware)ilorestssaclissaduclidebugFzcapture debug data)defaultdescc                 n   d}dg}g d}| j                  |D cg c]	  }| d|  c}       t        j                  d      }|dz   }| j                  |      }g }|d   dk(  rD|d	   j	                         D 	
cg c]&  }	|j                  |	      }
|
r|
j                  d
      ( }}	}
|dz   }| j                  |D cg c]  }|D ]  }| | d|   c}}       | j                         }| j                  d| dd       | j                  d      r| j                  |       y y c c}w c c}
}	w c c}}w )Nr   zctrl all show status)zarray all show detailzld all showzld all show detailzpd all showzpd all show detailzshow detail z#^HP[E] (.*) in Slot ([0123456789]+)z ctrl all show config detailstatusr   output   z ctrl slot=zssaducli -v -adu -f z/adu-log.zipzssaducli_-v_-adu.log)suggest_filenamer   )
add_cmd_outputrecompilecollect_cmd_output
splitlinessearchgroupget_cmd_output_path
get_optiondo_debug)selfcmdsubcmdsslot_subcmdssubcmdpatternconfig_detail_cmdconfig_detail
ctrl_slotslinemssacli_ctrl_slot_cmdslotslot_subcmdlogpaths                  :/usr/lib/python3/dist-packages/sos/report/plugins/hpssm.pysetupzHpssm.setup   s|   "

 	-456uAfX5	
 **BC"@@//0AB
"a'&3H&=&H&H&J@"$+NN4$8aQ ''!* @J @  #]2#. ,. %%dV1[M: .: .	
 **,"7)<83 	 	

 ??7#MM'" $3 6@
.s   D&9+D+<D1
c                 2    | j                  d| |d       y)z Collect debug logs z3ilorest serverlogs --selectlog=AHS --directorypath=zilorest.log)runatr   N)r   )r"   r0   s     r1   r!   zHpssm.do_debugI   s$    A'KM 	 	
    N)__name__
__module____qualname____doc__
short_descplugin_nameprofilespackagesr   option_listr2   r!    r5   r1   r   r      s>     /JK1H1H 	'5/CDK(#T
r5   r   )r   sos.report.pluginsr   r   r   r   r?   r5   r1   <module>rA      s!    
 C CA
F% A
r5   