a >h @s&ddlmZmZGdddeeZdS))Plugin RedHatPluginc@s,eZdZdZdZdZdZddZddZd S) SaphanazSAP HANAZsaphana)Zsap)z/hanacCs"g}|dr|d}|D]"}t|dkr|}||q|D]}|d}d|d}|j|d|dd|j|d |d d|j|d |d d|j|d |dd|d|drF|d|dD]*}d|vr|dd}||||qqFdS)Nz /hana/sharedZadmzsu - z -cz "HDB info"Z _HDB_infoZsuggest_filenamez "hdbsrvutil -v"_versionz 'hdbcons "mm l -s -S -p"'Z _memusagezS 'hdbcons -e hdbindexserver "replication info"'Z _replicainfoz /hana/shared//ZHDB) path_isdirlistdirlenstripappendloweradd_cmd_output get_inst_info)selfZsidsZsharedsidsidadmprefixinstr>/usr/lib/python3.9/site-packages/sos/report/plugins/saphana.pysetups6         z Saphana.setupc Cstd}|d|d}|j|||f|dd|d|d}||rpd}|d|d }|j|||f|dd S) z! Collect the given instance info z7su - %s -c "sapcontrol -nr %s -function GetProcessList"_Z_statusrz /usr/sap/z/HDBz/exe/python_supportz4su - %s -c "python %s/landscapeHostConfiguration.py"Z_landscapeConfigN)rr ) rrrrZproc_cmdZ status_fnamepathZpy_cmdZpy_fnamerrrr5s   zSaphana.get_inst_infoN) __name__ __module__ __qualname__Z short_descZ plugin_nameZprofilesfilesrrrrrrr s "rN)Zsos.report.pluginsrrrrrrr s