o id @s2ddlmZmZmZddlZGdddeeZdS))PluginIndependentPlugin PluginOptNc@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 Managementhpssm)systemstoragehardware)ilorestssaclissaduclidebugFzcapture debug data)defaultdesccsddg}gd|fdd|Dtdd}||}g}|dd kr8fd d|d D}d |fd d|D|}|jd|dd|drb||dSdS)Nr zctrl all show status)zarray all show detailz ld all showzld all show detailz pd all showzpd all show detailz show detailcsg|]}d|fqS)z%s %s).0subcmd)cmdr:/usr/lib/python3/dist-packages/sos/report/plugins/hpssm.py -szHpssm.setup..z,^HP.*Smart Array (.*) in Slot ([0123456789])z ctrl all show config detailstatusrcs$g|]}|}|r|dqS))searchgroup)rlinem)patternrrr5s outputz ctrl slot=cs$g|]}D] }d||fqqS)z%s%s %sr)rslot slot_subcmd) slot_subcmdsssacli_ctrl_slot_cmdrrr:s z"ssaducli -v -adu -f %s/adu-log.zipzssaducli_-v_-adu.log)suggest_filenamer )add_cmd_outputrecompilecollect_cmd_output splitlinesget_cmd_output_path get_optiondo_debug)selfsubcmdsconfig_detail_cmd config_detail ctrl_slotslogpathr)rrr r!rsetups:        z Hpssm.setupcCs|jd||dddS)Nz5ilorest serverlogs --selectlog=AHS --directorypath=%sz ilorest.log)runatr")r#)r+r0rrrr*Ms zHpssm.do_debugN) __name__ __module__ __qualname____doc__ short_desc plugin_nameprofilespackagesr option_listr1r*rrrrr s  .r)sos.report.pluginsrrrr$rrrrrs