https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/sos/report/plugins/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/sos/report/plugins/__pycache__/ceph_mgr.cpython-310.pyc
o

-�_g��@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 mgr�ceph_mgr)�storage�virt�	container�ceph)z/var/lib/ceph/mgr/*z/var/lib/ceph/*/mgr*z%/var/snap/microceph/common/data/mgr/*)zceph-(.*-)?mgr.*cs*|�d�}|jj�d�}gd�}|�d�}|ddkr!|gd�7}gd��d	}|sPd
}|�ddi�|�gd
��|sB|�dg�n|�dg�|�gd��nd}|�ddi�|�dg�|sh|�dg�n|�dg�|�dd�|D��|jdd�|D�dd�|��fdd�|�	|�D��dS)N�all_logs�	microceph)z
balancer evalzbalancer statuszbalancer status detailzhealthcheck history lszlog last cephadmzmgr dumpzmgr metadataz
mgr module lszmgr serviceszmgr statzmgr versionszceph orch status�statusr)zorch host lszorch device lszorch lszorch ls --exportzorch pszorch status --detailzorch upgrade status)zconfig diffzconfig showzcounter dumpzcounter schema�
dump_cache�
dump_mempools�dump_osd_network�mds_requests�mds_sessions�objecter_requestsz	perf dumpzperf histogram dumpzperf histogram schemazperf 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*cSsg|]}d|���qS)�ceph ���.0�cmdrr�=/usr/lib/python3/dist-packages/sos/report/plugins/ceph_mgr.py�
<listcomp>�sz!CephMGR.setup.<locals>.<listcomp>cSsg|]}d|�d��qS)rz --format json-prettyrrrrrr�s�json_output)�subdircs&g|]}�D]
}d|�d|���qqS)zceph daemon � r)r�mr��cmdsrrr�s���)
�
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�	directoryrr"r�setup-s^


����������z
CephMGR.setupcCsNg}t�|�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
        zceph-mgrz.asok)�os�walk�
startswith�endswith�append�	path_join)r.r2�ceph_sockets�rdir�_�files�filerrrr-�s��zCephMGR.get_socksN)�__name__�
__module__�__qualname__�__doc__�
short_desc�plugin_name�profilesr=�
containersr3r-rrrrrsur)r4�sos.report.pluginsrrrrrrrr�<module>s


https://t.me/RX1948 - 2025