Current File : //usr/lib/python2.7/site-packages/sos/plugins/pcp.pyo
�
u��ec@sdddlmZmZmZddlZddlZddlmZdeeefd��YZdS(i����(tPlugintRedHatPlugintDebianPluginN(tgethostnametPcpcBseeZdZdZdZdZdZddgZdZ	dZ
dZdZd�Z
d
�Zd�ZRS(sPerformance Co-Pilot data
    tpcptsystemtperformances
/etc/pcp.conft	pmmgrlogsssize-limit in MB of pmmgr logstidt
pmloggerfiless'number of newest pmlogger files to grabicCsid}x\tj|�D]K\}}}x9|D]1}tjj||�}|tjj|�7}q,WqW|S(Ni(tostwalktpathtjointgetsize(tselfR
t
total_sizetdirpathtdirnamest	filenamestftfp((s3/usr/lib/python2.7/site-packages/sos/plugins/pcp.pytget_size's
cCs�y,t|jd�}|j�}|j�Wntk
r@tSXi}xf|D]^}|jd�riqNny)|j�jd�\}}|||<WqNt	t
fk
r�qNXqNWy+|d|_|d|_|d|_
Wntk
r�tSXtS(Ntrt#t=tPCP_SYSCONF_DIRtPCP_VAR_DIRtPCP_LOG_DIR(topentpcp_conffilet	readlinestclosetIOErrortFalset
startswithtstriptsplitt
ValueErrortKeyErrortpcp_sysconf_dirtpcp_var_dirtpcp_log_dirt	ExceptiontTrue(Rtpcpconftlinestenv_varstlinetkeytvalue((s3/usr/lib/python2.7/site-packages/sos/plugins/pcp.pytpcp_parse_conffile/s,




c	Cs�|jd�rdn|jd�|_|jd�r<dn|jd�|_|j�sr|jd|j�dStjj	|j
d�}|j|j|j|g�|j
tjj	|d�tjj	|d�tjj	|d�tjj	|d	�g�t�|_|jd
kr�tjj	|jd|jd�}|j|d
|jdt�d}tjj	|jd|jd�}|jd|�}|ddkr�xT|dj�D]?}|j|d
d�|d}|jr�||jkr�Pq�q�Wq�n|jtjj	|jd�tjj	|jd�tjj	|j
d�tjj	|jd�tjj	|jd�tjj	|jd�g�|jd�}|ddkr�xU|dj�D]@}|jd�r�|j�d}|jd|dd �Pq�q�WndS(!Ntall_logsRR
scould not parse %stconfigtpmchartt	pmlogconftpmieconftpmlogrewriteR	tpmmgrt*t	sizelimitttailititpmloggers	ls -t1 %ststatustoutputitpmcdsNOTICES*tpmnss*/*.log*s
*/*/*.log*s*/*/config*Rs
 pmlogger:i����s'pmstat -S 00:00 -T 23:59 -t 5m -x -a %stroot_symlinktpmstat(t
get_optiontNoneR=t
countlimitR4t	_log_warnRRR
RR*t
add_copy_specR)tadd_forbidden_pathRtpcp_hostnameR+R#texec_cmdt
splitlinestcollect_cmd_outputR$R&tadd_cmd_output(Rtvar_conf_dirR
tfiles_collectedtpmlogger_lsR1trestarc((s3/usr/lib/python2.7/site-packages/sos/plugins/pcp.pytsetupJs`


(ssystemR(spcp(s	pmmgrlogsssize-limit in MB of pmmgr logsR	id(s
pmloggerfiless'number of newest pmlogger files to grabR	iN(t__name__t
__module__t__doc__tplugin_nametprofilestpackagesRtoption_listRGR)R*R+RLRR4RV(((s3/usr/lib/python2.7/site-packages/sos/plugins/pcp.pyRs			(	tsos.pluginsRRRRtos.pathtsocketRR(((s3/usr/lib/python2.7/site-packages/sos/plugins/pcp.pyt<module>s