3 ܓi @s2ddlZddlmZmZmZGdddeeZdS)N)PluginIndependentPlugin PluginOptc@s@eZdZdZdZdZdZdZed d d d gZ ddZ ddZ dS)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). zHP Smart Storage ManagementZhpssmsystemstoragehardwareilorestssaclissaduclidebugFzcapture debug data)defaultZdesccsddg}ddddddg|jfd d |Dtjd d }|j|}g}|d dkrxfdd |djD}d|jfdd |D|j}|jd|ddd|jdr|j|dS)Nr zctrl all show statuszarray all show detailz ld all showzld all show detailz pd all showzpd all show detailz show detailcsg|]}d|qS) ).0Zsubcmd)cmdr/usr/lib/python3.6/hpssm.py -szHpssm.setup..z#^HP[E] (.*) in Slot ([0123456789]+)z ctrl all show config detailZstatusrcs,g|]$}j|gD]}|r|jdqqS))searchgroup)rlinem)patternrrr5soutputz ctrl slot=cs(g|] }D]}|d|q qS)rr)rZslotZ slot_subcmd) slot_subcmdsssacli_ctrl_slot_cmdrrr:szssaducli -v -adu -f z /adu-log.zipzssaducli_-v_-adu.log)suggest_filenamer )add_cmd_outputrecompileZcollect_cmd_output splitlinesZget_cmd_output_pathZ get_optiondo_debug)selfZsubcmdsZconfig_detail_cmdZ config_detailZ ctrl_slotslogpathr)rrrrrsetups6        z Hpssm.setupcCs|jd||dddS)z Collect debug logs z3ilorest serverlogs --selectlog=AHS --directorypath=z ilorest.log)ZrunatrN)r)r#r$rrrr"IszHpssm.do_debugN)rrr)r r r ) __name__ __module__ __qualname____doc__Z short_descZ plugin_nameZprofilesZpackagesrZ option_listr%r"rrrrr s*r)rZsos.report.pluginsrrrrrrrr s