
    ~ g                     :    S SK r S SKJrJrJr   " S S\\\5      rg)    N)PluginRedHatPluginUbuntuPluginc                   8    \ rS rSrSrSrSrSrSrSr	S r
S	 rS
rg)CephMGR   a  
This plugin is for capturing information from Ceph mgr nodes. While the
majority of this plugin should be version-agnostic, several collections are
dependent upon the version of Ceph installed. Versions that correlate to
RHCS 4 or RHCS 5 are explicitly handled for differences such as those
pertaining to log locations on the host filesystem.

Note that while this plugin will activate based on the presence of Ceph
containers, commands are run directly on the host as those containers are
often not configured to successfully run the `ceph` commands collected by
this plugin. These commands are majorily `ceph daemon` commands that will
reference discovered admin sockets under /var/run/ceph.

Users may expect to see several collections twice - once in standard output
from the `ceph` command, and again in JSON format. The latter of which will
be placed in the `json_output/` subdirectory within this plugin's directory
in the report archive. These JSON formatted collections are intended to
aid in automated analysis.
zCEPH mgrceph_mgr)storagevirt	containerceph)z/var/lib/ceph/mgr/*z/var/lib/ceph/*/mgr*z%/var/snap/microceph/common/data/mgr/*)zceph-(.*-)?mgr.*c                    U R                  S5      nU R                  R                  R                  S5      n/ SQnU R	                  S5      nUS   S:X  a  U/ SQ-  n/ SQnS	nU(       dh  S
nU R                  SS05        U R                  / SQ5        U(       d  U R                  S/5        OU R                  S/5        U R                  / SQ5        OSSnU R                  SS05        U R                  S/5        U(       d  U R                  S/5        OU R                  S/5        U R                  U Vs/ s H  nSU 3PM
     sn5        U R                  U Vs/ s H	  nSU S3PM     snSS9  U R                  U R                  U5       VVs/ s H  nU  H  nSU SU 3PM     M     snn5        g s  snf s  snf s  snnf )Nall_logs	microceph)zbalancer evalzbalancer statuszbalancer status detailzhealthcheck history lszlog last cephadmzmgr dumpzmgr metadatazmgr module lszmgr serviceszmgr statzmgr versionszceph orch statusstatusr   )zorch host lszorch device lszorch lszorch ls --exportzorch pszorch status --detailzorch upgrade status)zconfig diffzconfig showzcounter dumpzcounter schema
dump_cachedump_mempoolsdump_osd_networkmds_requestsmds_sessionsobjecter_requestsz	perf dumpzperf histogram dumpzperf histogram schemazperf schemar   version z/var/run/cephz"/var/log/ceph/(.*/)?ceph-mgr.*.logceph_mgr_log)z/etc/ceph/*keyring*z/var/lib/ceph/**/*keyring*z/var/lib/ceph/**/osd*z/var/lib/ceph/**/mon*z/var/lib/ceph/**/tmp/*mnt*z/etc/ceph/*bindpass*z/var/log/ceph/**/ceph-mgr*.logz/var/log/ceph/**/ceph-mgr*.log*)z/var/lib/ceph/**/mgr*z/var/lib/ceph/**/bootstrap-mgr/z/run/ceph/**/ceph-mgr*z/var/snap/microceph/current/runz./var/snap/microceph/common/logs/ceph-mgr.*.logz'/var/snap/microceph/common/**/*keyring*z-/var/snap/microceph/common/logs/ceph-mgr*.logz./var/snap/microceph/common/logs/ceph-mgr*.log*zceph z --format json-prettyjson_output)subdirzceph daemon  )

get_optionpolicypackage_managerpkg_by_nameexec_cmdadd_file_tagsadd_forbidden_pathadd_copy_specadd_cmd_output	get_socks)	selfr   microceph_pkgceph_mgr_cmdsorch_configuredcmds	directorycmdms	            =/usr/lib/python3/dist-packages/sos/report/plugins/ceph_mgr.pysetupCephMGR.setup-   s   ??:.33??L
 --(:;8$)  M
& 	'I4n   ## 	% 	 ""4$  ""5$      :I@  
 ##9%  ""C$  ""D$  	&34msuSE]m4	6 	;HI=CuSE./=I  	 	

 	.2nnY.G.G 1#Qse$ %.G 	
 5 Js   3F2F7F<
c                     / n[         R                  " U5       H_  u  p4nU HS  nUR                  S5      (       d  M  UR                  S5      (       d  M3  UR	                  U R                  X65      5        MU     Ma     U$ )z
Find any available admin sockets under /var/run/ceph (or subdirs for
later versions of Ceph) which can be used for ceph daemon commands
zceph-mgrz.asok)oswalk
startswithendswithappend	path_join)r(   r-   ceph_socketsrdir_filesfiles          r0   r'   CephMGR.get_socks   sf    
  ggi0NDU??:..4==3I3I ''t(BC  1      N)__name__
__module____qualname____firstlineno____doc__
short_descplugin_nameprofilesr=   
containersr1   r'   __static_attributes__rA   r@   r0   r   r      s0    ( JK7H6E&Js
j
r@   r   )r4   sos.report.pluginsr   r   r   r   rA   r@   r0   <module>rM      s"    
 A A\flL \r@   