+
    i'  c                   s<    ^ RI t ^ RIHtHtHt  ! R R]]]4      tR# )i    N)PluginRedHatPluginUbuntuPluginc                   sT   a  ] tR t^t o RtRtRtR
tRtRt	^ t
R tR tR tR tRtV tR	# )CephMONa:  
This plugin serves to collect information on monitor nodes within a Ceph
or microceph cluster. It is designed to collect from several versions of
Ceph, including versions that serve as the basis for RHCS 4 and RHCS 5.

Older versions of Ceph will have collections from locations such as
/var/log/ceph, whereas newer versions (as of this plugin's latest update)
will have collections from /var/log/ceph/<fsid>/. This plugin attempts to
account for this where possible across the host's filesystem.

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 monZceph_monc                s\   V P                  R 4      pV P                  4       V n        V P                  P                  P                  R4      pV'       gj   V P                  RRRR/4       V P                  . RDO4       V'       g   V P                  R.4       MV P                  R.4       V P                  RR	.4       MSV P                  . REO4       V'       g   V P                  R
.4       MV P                  R.4       V P                  RR.4       V P                  RRRR7       V P                  . RNRNRNRNRNRNRNRNRNRNRNRNRNRNR NR!NR"NR#NR$NR%NR&NR'NR(NR)NR*NR+NR,NR-NR.NR/NR0NR1N4       V P                  R4      pVR2,          ^ 8X  dc   VR3,          P                  4        FG  pVP                  R44      '       g   K  VP                  4       ^ ,          pV P                  R5V 24       KI  	  . RFOpV P                  R6R7R8R97       V P                  R:R7R;R97       V P                  4        F   pV P                  R<V R=2R<V R>2.R7R?7       K"  	  T P                  V Uu. uF  pR@V 2NK
  	  up4       T P                  V Uu. uF	  pR@V RA2NK  	  upR7RRB7       RC# u upi u upi )Gall_logsZ	microcephz.*/ceph.confZ	ceph_confz$/var/log/ceph/(.*/)?ceph-.*mon.*.logZceph_mon_logz/var/log/ceph/**/*ceph-mon*.logz /var/log/ceph/**/*ceph-mon*.log*z/run/ceph/**/ceph-mon*z/var/lib/ceph/**/kv_backendz./var/snap/microceph/common/logs/*ceph-mon*.logz//var/snap/microceph/common/logs/*ceph-mon*.log*%/var/snap/microceph/common/data/mon/*z"/var/snap/microceph/current/conf/*zceph reportZceph_reportF)tagsstderrz!ceph config generate-minimal-confzceph config logceph config-key dumpzceph crash lszceph crash statzceph featureszceph health detailzceph insightszceph log last 10000 debug auditz!ceph log last 10000 debug clusterzceph mgr dumpzceph mgr metadatazceph mgr module lszceph mgr serviceszceph mgr versionszceph mon statzceph mon features lszceph node lszceph osd crush class lszceph osd crush dumpzceph osd crush rule lszceph osd crush show-tunablesz!ceph osd crush tree --show-shadowz ceph osd erasure-code-profile lszceph osd metadatazceph osd utilizationzceph telemetry channel lszceph telemetry collection lszceph telemetry lszceph quorum_statuszceph versionszceph-disk liststatusoutputZ*zceph crash info z'ceph health detail --format json-prettyZjson_outputZceph_health_detail)subdirr   z"ceph osd tree --format json-prettyZceph_osd_treezceph tell mon.z mon_statusz	 sessions)r   zceph z --format json-pretty)r   r   N)z/etc/ceph/*keyring*z/var/lib/ceph/**/*keyring*z/var/lib/ceph/**/tmp/*mnt*z/etc/ceph/*bindpass*)z'/var/snap/microceph/common/**/*keyring*z(/var/snap/microceph/current/**/*keyring*z./var/snap/microceph/common/data/mon/*/store.dbz"/var/snap/microceph/common/state/*)zconfig dumpz	device lsz	df detailZdfzfs dumpzfs lsz	fs statuszmds statzmon dumpzosd blocked-byzosd blocklist lszosd df treezosd dfzosd dumpzosd numa-statuszosd perfzosd pool autoscale-statuszosd pool availability-statuszosd pool ls detailzosd statzpg dumpzpg dump_stuckzpg statr	   ztime-sync-status)Z
get_optionget_ceph_versionceph_versionZpolicyZpackage_managerZpkg_by_nameZadd_file_tagsZadd_forbidden_pathZadd_copy_specZadd_cmd_outputZcollect_cmd_output
splitlinesendswithsplitget_ceph_ids)	selfr   Zmicroceph_pkgZcrashesZcrashlnZcidZ	ceph_cmdsZmidZcmd	   &        @/usr/lib/python3.14/site-packages/sos/report/plugins/ceph_mon.pysetupZCephMON.setup,   s   ??:. 11333??L6  
 ## %  ""5$  ""6$  (-   ## %  ""D$  ""E$  74  
 	MeL $
 0	$

 $
 #$
 $
 $
 $
 !$
 $
 .$
 0$
 $
  $
  !!$
"  #$
$  %$
& '$
( #)$
* +$
, &-$
. "/$
0 %1$
2 +3$
4 05$
6 /7$
8  9$
: #;$
< (=$
> +?$
@  A$
B !C$
D E$
F G$
 $	L ))/:8!"8,779##C((!--/!,C''*:3%(@A :

	8 	E#0!5 	 	7 	@#0!0 	 	2 $$&C [1 Y/! $   % ' 	i@isuSE]i@A 	;DE9CuSE./9E  	 	
 A Fs   %J$	J)c                s>   V P                  R4      pVR,          ^ 8X  dA    VR,          P                  4       ^,          p\        VP                  R4      ^ ,          4      # V P                  R4       ^ #   \         d   pT P	                  RT 24        Rp?L7Rp?ii ; i)z$Get the versions of running daemons zceph --versionr	   r
   Z.z"Could not determine ceph version: Nz?Failed to find ceph version, command collection will be limited)exec_cmdr   Zint	Exception
_log_debugZ
_log_error)r   ZverZ_vererr   &   r   r   ZCephMON.get_ceph_version   s     mm,-x=AL8}**,Q/4::c?1-.. 	M	
   L"DSE JKKLs   >A3 3B>BBc                s8   . pV P                   R9   d   V P                  R4      pVR,          ^ 8X  d   VR,          P                  4        Fm  pVP                  4       pV'       g   K  V^ ,          P	                  R4      '       g   K=   VP                  R4      pVP                  WE^,           ,          4       Ko  	  V# V P                   ^8  dv   V P                  R4      pVR,          ^ 8X  dW    \        P                  ! RVR,          4      pVP                  VP                  4       ^,          P                  R	4      4       V# V#   \        \        3 d    T P                  R4        EK!  i ; i  \         d    pT P                  R
T 24        Rp?T# Rp?ii ; i)z Get the IDs of the Ceph daemons zps -u ceph -o argsr	   r
   zceph-monz--idzUnable to find ceph IDszceph statusz!(\s*mon: .* quorum) (.*) (\(.*\))Z,zid determination failed: N)i   i   )r   r   r   r   r   ZindexZappendZ
IndexErrorZ
ValueErrorZ	_log_warnreZsearchZextendZgroupsr   r   )	r   Zceph_idsZoutZprocsZprocZid_indexZstatsZretr   r   r   r   ZCephMON.get_ceph_ids   sf    (-- 45C8}! ]557E ;;=DtQ 0 0 < <F'+zz&'9H$OODA,>? 8(  "$MM-0EX!#G))$H$)(O5COOCJJLO$9$9#$>? x !+J7 F NN+DEEF ! GOO&?u$EFFGs+   /E.AE/ "E,+E,/F:FFc                s    V P                   ^8  d(   . R
OpV F  pRV R2pV P                  RVR4       K  	  M,. ROpRRP                  V4       R2pV P                  RVR4       V P                  R4       R	# )i   z(((.*)(z\\\": ))((\\\"(.*?)\\\")(.*)))r   z\2\"******\"\8z((\".*(Z|z)\":) \")(.*)(\".*)z\1*******\5N)keyZusernameZpassword_secretrbd/mirror/peer/.*)ZAPI_PASSWORDz
API_USER.*z
API_.*_KEYr   r   r   )r   Zdo_cmd_output_subZjoinZdo_cmd_private_sub)r   Zkeysr   Zcregr   r   postprocZCephMON.postproc   s    "D !#&DE&&.6G D chhtn--@AD""*D. 	 67    )r   N)ZstorageZvirtZ	containerZceph)zceph-(.*-)?mon.*)z/var/lib/ceph/mon/*z/var/lib/ceph/*/mon*r   )Z__name__Z
__module__Z__qualname__Z__firstlineno__Z__doc__Z
short_descZplugin_nameZprofilesZ
containersZfilesr   r   r   r   r   Z__static_attributes__Z__classdictcell__)Z__classdict__s   @r   r   r      sJ     " JK7H 'J6ELU
nB!8 !8r    r   )r   Zsos.report.pluginsr    r   r   r   ) r    r   <module>r!      s"    
 A AF8flL F8r    