HEX
Server: Apache
System: Linux scp1.abinfocom.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: confeduphaar (1010)
PHP: 8.1.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //usr/lib/python3/dist-packages/sos/report/plugins/__pycache__/ceph_mgr.cpython-38.pyc
U

i��d��@s4ddlZddlmZmZmZGdd�deee�ZdS)�N)�Plugin�RedHatPlugin�UbuntuPluginc@s4eZdZdZdZdZdZdZdZdd�Z	d	d
�Z
dS)�CephMGRa?
    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.
    zCEPH mgrZceph_mgr)ZstorageZvirtZ	containerZceph)z/var/lib/ceph/mgr/*z/var/lib/ceph/*/mgr*)zceph-(.*-)?mgr.*cs�|�ddi�|�ddddddg�|�d	d
ddg�d
ddddddddg	}|�dd�|D��|jdd�|D�dd�dddddd d!d"d d!d#d$d%d&d'd(g�|��fd)d�|��D��dS)*Nz"/var/log/ceph/(.*/)?ceph-mgr.*.logZceph_mgr_logz/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/lib/ceph/**/mgr*z/var/lib/ceph/**/bootstrap-mgr/z/run/ceph/**/ceph-mgr*zbalancer statuszorch host lszorch device lszorch lszorch ls --exportzorch pszorch status --detailzorch upgrade statuszlog last cephadmcSsg|]}d|���qS)�ceph ���.0�cmdrr�=/usr/lib/python3/dist-packages/sos/report/plugins/ceph_mgr.py�
<listcomp>Psz!CephMGR.setup.<locals>.<listcomp>cSsg|]}d|�d��qS)rz --format json-prettyrrrrrrSsZjson_output)Zsubdirzconfig diffzconfig showZ
dump_cacheZ
dump_mempoolsZdump_osd_networkZmds_requestsZmds_sessionsZobjecter_requestsz	perf dumpzperf histogram dumpzperf histogram schemazperf schemaZstatus�versioncs&g|]}�D]}d|�d|���qqS)zceph daemon � r)r	�mr
�Zcmdsrrrjs)Z
add_file_tagsZadd_forbidden_pathZ
add_copy_specZadd_cmd_output�	get_socks)�selfZ
ceph_mgr_cmdsrrr�setup*sn���	�����z
CephMGR.setupcCsNg}t�d�D]:\}}}|D]*}|�d�r|�d�r|�|�||��qq|S)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/var/run/ceph/zceph-mgrz.asok)�os�walk�
startswith�endswith�appendZ	path_join)rZceph_socketsZrdir�dirs�files�filerrrrnszCephMGR.get_socksN)�__name__�
__module__�__qualname__�__doc__Z
short_descZplugin_nameZprofilesrZ
containersrrrrrrrsDr)rZsos.report.pluginsrrrrrrrr�<module>	s