id":ddlZddlmZmZmZGddeeeZy)N)Plugin RedHatPlugin UbuntuPluginc@eZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z y ) CephMONan 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//. 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. zCEPH monceph_mon)storagevirt containerceph)zceph-(.*-)?mon.*)z/var/lib/ceph/mon/*z/var/lib/ceph/*/mon*%/var/snap/microceph/common/data/mon/*rc|j|_|jjj d}|s;|j ddd|j gd|jgdn&|j gd|jgd|jd d |jgd |jd }|ddk(rQ|djD];}|jds|jd}|jd|=gd}|jddd|jddd|j|jDcgc]}d|d c}d|j|Dcgc]}d| c}|j|Dcgc]}d|d c}dycc}wcc}wcc}w)N microceph ceph_conf ceph_mon_log)z .*/ceph.confz$/var/log/ceph/(.*/)?ceph-.*mon.*.log)z/etc/ceph/*keyring*z/var/lib/ceph/**/*keyring*z/var/lib/ceph/**/tmp/*mnt*z/etc/ceph/*bindpass*)z/run/ceph/**/ceph-mon*z/var/lib/ceph/**/kv_backendz/var/log/ceph/**/*ceph-mon*.log)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/*)r z./var/snap/microceph/common/logs/*ceph-mon*.logz"/var/snap/microceph/current/conf/*z ceph report ceph_report)tags)z ceph mon statzceph quorum_statuszceph-disk listz ceph versionsz ceph featuresz ceph insightszceph crash statzceph config dumpzceph config logz!ceph config generate-minimal-confceph config-key dumpzceph osd metadataz ceph osd erasure-code-profile lszceph osd crush dumpzceph osd crush show-tunablesz!ceph osd crush tree --show-shadowz ceph mgr dumpzceph mgr metadatazceph mgr module lszceph mgr serviceszceph mgr versionsz!ceph log last 10000 debug clusterzceph log last 10000 debug auditz ceph crash lsstatusroutput*zceph crash info )zmon dumprz device lsdfz df detailzfs lszfs dumpzpg dumpzpg statztime-sync-statuszosd statz osd df treezosd dumpzosd dfzosd perfzosd blocked-byzosd pool ls detailzosd pool autoscale-statuszmds statzosd numa-statusz'ceph health detail --format json-pretty json_outputceph_health_detail)subdirrz"ceph osd tree --format json-pretty ceph_osd_treezceph tell mon.z mon_status)rzceph z --format json-pretty)get_ceph_version ceph_versionpolicypackage_manager pkg_by_name add_file_tagsadd_forbidden_path add_copy_specadd_cmd_outputcollect_cmd_output splitlinesendswithsplit get_ceph_ids)self microceph_pkgcrashescrashlncid ceph_cmdsmidcmds =/usr/lib/python3/dist-packages/sos/report/plugins/ceph_mon.pysetupz CephMON.setup,s 113 33?? L     +8F    # #%        # #%       M >   :))/: 8  !"8,779 B##C(!--/!,C''*:3%(@A B  . E#0!5  7 @#0!0  2 :>:K:K:M N3~cU+ . N   i@suSE]@A ;D ECuSE. / E    OA Fs7 G G> Gc|jd}|ddk(r4 |djd}t|jddS|j dy#t$r}|j d|Yd}~4d}~wwxYw) Nzceph --versionrrr.z"Could not determine ceph version: z?Failed to find ceph version, command collection will be limited)exec_cmdr)int Exception _log_debug _log_error)r+ver_vererrs r3rzCephMON.get_ceph_versionsmm,- x=A  L8}**,Q/4::c?1-..  M   L"DSE JKK Ls2A B)BBcg}|jdk(s|jdk(r|jd}|ddk(ri|djD]S}|j}|s|dj ds+ |j d}|j ||d zU|S|jd k\rf|jd }|ddk(rM tjd |d}|j|jd jd|S|S#ttf$r|jd YwxYw#t$r}|jd|Yd}~|Sd}~wwxYw)Nzps -u ceph -o argsrrrzceph-monz--idzUnable to find ceph IDsz ceph statusz!(\s*mon: .* quorum) (.*) (\(.*\)),zid determination failed: )rr8r'r)r(indexappend IndexError ValueError _log_warnresearchextendgroupsr:r;) r+ceph_idsoutprocsprocid_indexstatsretr?s r3r*zCephMON.get_ceph_idssr    "d&7&72&=-- 45C8}! ]557FE ;;=DQ 0 0 <F'+zz&'9H$OODA,>? F(  " $MM-0EX!#G))$H$)(O5COOCJJLO$9$9#$>?x!+J7F NN+DEF!GOO&?u$EFFGs+9(DA E D?>D? E* E%%E*c|jdk\r%gd}|D]}d|d}|jd|dn,gd}dd j|d }|jd|d |jdy) NrD)keyusernamepassword_secretrbd/mirror/peer/.*z(((.*)(z\\\": ))((\\\"(.*?)\\\")(.*)))rz\2\"******\"\8) API_PASSWORDz API_USER.*z API_.*_KEYrWrZr[z((\".*(|z)\":) \")(.*)(\".*)z \1*******\5)rdo_cmd_output_subjoindo_cmd_private_sub)r+keysrWcregs r3postproczCephMON.postprocs    "D !#&DE&&.6G  Dchhtn--@AD  " "*D.   67N)__name__ __module__ __qualname____doc__ short_desc plugin_nameprofiles containersfilesrr4rr*rcrdr3rrsA"JK7H'J 6ELu n >!8rdr)rKsos.report.pluginsrrrrrnrdr3rps" AAb8flLb8rd