ó uÈÔec@sHddlZddlmZmZd„Zdeefd„ƒYZdS(iÿÿÿÿN(tPlugint RedHatPlugincCs1ytj|ƒ}Wntk r,g}nX|S(N(tostlistdirtOSError(tpathtdir_list((s5/usr/lib/python2.7/site-packages/sos/plugins/sapnw.pytget_directory_listing s   tsapnwcBsAeZdZdZdgZdgZd„Zd„Zd„ZRS(s SAP NetWeaverRtsaps/usr/sapc Cs |jdddƒ}|ddkr)dStƒ}xw|djƒD]e}d|krC|jƒjƒ}|d}|d }|d }|j|ƒxtd |ƒD]þ}||kr£||kr£||kr£d |} d |} |jƒ} |jd| | || fdd| ƒ|jd| | |fdd||fƒ|jd| | |fdd||fƒ|jƒ} |jd| |fdd|| |fƒq£q£WqCqCWxY|D]Q}xHtd|ƒD]6}d|krÊ|jd||fdd|ƒqÊqÊWq³WdS(Ns9/usr/sap/hostctrl/exe/saphostctrl -function ListInstancestsuggest_filenamet SAPInstanceststatusitoutputtDAAiiis/usr/sap/%s/SYS/profile/s'LD_LIBRARY_PATH=/usr/sap/%s/SYS/exe/runs"/usr/sap/%s/SYS/exe/uc/linuxx86_64sSenv -i %s %s/sappfpar all pf=/usr/sap/%s/SYS/profile/%ss %s_parameterssSenv -i %s %s/sapcontrol -nr %s -function GetProcessLists%s_%s_GetProcListsSenv -i %s %s/sapcontrol -nr %s -function GetVersionInfos%s_%s_GetVersInfosVsu - %sadm -c "sapcontrol -nr %s -function GetEnvironment"s%s_%sadm_%s_userenvs /usr/sap/%s/tDVEBs/grep 'client driver' /usr/sap/%s/%s/work/dev_w0s %s_dbclient( tcollect_cmd_outputtsett splitlineststriptsplittaddRtadd_cmd_outputtlower( tselftinst_outt sidsuniquet inst_linetfieldstsidtinsttvhosttlinetldenvtpttprofiletlowsid((s5/usr/lib/python2.7/site-packages/sos/plugins/sapnw.pytcollect_list_instancessV        $       cCs[|jdddƒ}|ddkr)dSx+|djƒD]}d|kr:|jƒjƒ}|dd }|d d }|d jƒ}|d krº|jd |dd||fƒn|dkrî|dd }|jd||fƒn|dkr|dd }|jd|ƒn|dkrS|dd }|jd||fƒqSq:q:WdS(Ns9/usr/sap/hostctrl/exe/saphostctrl -function ListDatabasesR t SAPDatabasesR iR s Instance nameiiÿÿÿÿiitdb6ssu - %s -c "db2 get dbm cfg"s%s_%s_db2_infoR s/sapdb/%s/data/config/%s.pahtoras/oracle/%s/*/dbs/init.oratsybs/sybase/%s/ASE*/%s.cfg(RRRRtupperRt add_copy_spec(Rtdb_outR RtdbadmtdbtypeR((s5/usr/lib/python2.7/site-packages/sos/plugins/sapnw.pytcollect_list_dbs^s4       cCs+|jƒ|jƒ|jdddƒdS(Ns sapconf -nR tsapconf_checkmode(R%R/R(R((s5/usr/lib/python2.7/site-packages/sos/plugins/sapnw.pytsetup†s   ( t__name__t __module__t__doc__t plugin_nametprofilestfilesR%R/R1(((s5/usr/lib/python2.7/site-packages/sos/plugins/sapnw.pyRs   A ((Rt sos.pluginsRRRR(((s5/usr/lib/python2.7/site-packages/sos/plugins/sapnw.pyt s