a >h@s*ddlmZmZmZGdddeeZdS))PluginIndependentPlugin PluginOptc@sNeZdZdZdZdZdZdZefZe dddd gZ d d Z d d Z ddZ dS)SHMcliashmcli pulls hardware information from PowerVault/Dell Storage JBOD's attached to server. It provides information of the adapters, emms, drives, enclosures, fans, power supplies and the sensory data of temp, voltage, and current sensors. zDell Server Hardware Managershmcli)systemZstorageZhardwarezC/opt/dell/ServerHardwareManager/ServerHardwareManagerCLI/bin/shmclidebugFzcapture support debug data)defaultZdesccCsFgd}|D]$}|j|jd|d|dq ||dS)N)z list adapterszlist physical enclosureszlist failed drives Zshmcli_suggest_filename)add_cmd_output shmcli_bincollect_enclosures_listcollect_drivers_list)selfsubcmdssubcmdr=/usr/lib/python3.9/site-packages/sos/report/plugins/shmcli.pysetup sz SHMcli.setupc sg}|d}|ddkrb|dD]:}t|dkr&|ddkr&|dq&tt|}gd}|j|j d d d }|ddkr||ddd D]̉t fd d|Drd}d}|D]<}|j d|d|d|}| |j d} |j || d q| dr|jdd} |j d|d|} | |j d} d| } |j | | | ddqdS)z Collect info on the enclosures z lsscsi -gstatusroutputZDELL) z list emmsz list drawerszlist emm slotszlist drive slotsz list fanszlist temp sensorszlist voltage sensorszlist current sensorszlist power supplieszinfo enclosurez list enclosuresZshmcli_list_enclosuresr c3s|]}|vVqdS)Nr).0mlinerr Qz1SHMcli.collect_enclosures_list..r z -a=z -enc=rrF)Zmakez getdebugcli -a=z -outputdir=i,)r timeoutN)Zexec_cmd splitlinessplitlenupperappendlistsetcollect_cmd_outputranyreplacer Z get_optionZget_cmd_output_path)rZmodelsresultwordsrZ adapt_indexZ enc_indexr_cmd_fnameZlogpathZ_dcmdZ_dnameZ_odirrrrr0sL        zSHMcli.collect_enclosures_listcCs|j|jddd}|ddkr|dD]T}|}t|dkr.|ddvr.|jd |d}||jd }|j||dq.d S) z Collect info on the drives z list drivesZshmcli_list_drivesr rrr)ZWWNz---z info drive -d=rN)r+rr$r%r&r-r )rr.rr/r0r1rrrrds    zSHMcli.collect_drivers_listN)__name__ __module__ __qualname____doc__Z short_descZ plugin_nameZprofilesrfilesrZ option_listrrrrrrrr s 4rN)Zsos.report.pluginsrrrrrrrr s