a >h @s2ddlZddlmZmZmZGdddeeZdS)N)PluginIndependentPlugin PluginOptc@s@eZdZdZdZdZdZdZedddd gZ d d Z d d Z 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 ManagementZhpssm)systemZstorageZhardware)ZilorestssacliZssaduclidebugFzcapture debug data)defaultZdesccsddg}gd|fdd|Dtdd}||}g}|dd krpfd d|d D}d |fd d|D|}|jd|ddd|dr||dS)Nrzctrl all show status)zarray all show detailz ld all showzld all show detailz pd all showzpd all show detailz show detailcsg|]}d|qS ).0Zsubcmd)cmdr -zHpssm.setup..z#^HP[E] (.*) in Slot ([0123456789]+)z ctrl all show config detailstatusrcs$g|]}|}|r|dqS))searchgroup)r linem)patternr rr5soutputz ctrl slot=cs(g|] }D]}|d|q qSr r )r ZslotZ slot_subcmd) slot_subcmdsssacli_ctrl_slot_cmdr rr: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 )rrrrrsetups8        z Hpssm.setupcCs|jd||dddS)z Collect debug logs z3ilorest serverlogs --selectlog=AHS --directorypath=z ilorest.log)ZrunatrN)r)r"r#r r rr!IszHpssm.do_debugN) __name__ __module__ __qualname____doc__Z short_descZ plugin_nameZprofilesZpackagesrZ option_listr$r!r r r rr s *r)rZsos.report.pluginsrrrrr r r r s