관리-도구
편집 파일: ceph_mgr.cpython-39.pyc
a -�_g� � @ s4 d dl Z d dlmZmZmZ G dd� deee�ZdS )� N)�Plugin�RedHatPlugin�UbuntuPluginc @ s4 e Zd ZdZdZdZdZdZdZdd� 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)ZstorageZvirt� containerZceph)z/var/lib/ceph/mgr/*z/var/lib/ceph/*/mgr*z%/var/snap/microceph/common/data/mgr/*)zceph-(.*-)?mgr.*c s* | � d�}| jj�d�}g d�}| �d�}|d dkrB|g d�7 }g d�� d }|s�d }| �ddi� | �g d �� |s�| �dg� n| �dg� | �g d�� n<d}| �ddi� | �dg� |s�| �dg� n| �dg� | �dd� |D �� | jdd� |D �dd� | �� fdd�| � |�D �� d S )N�all_logsZ microceph)z balancer evalzbalancer statuszbalancer status detailzhealthcheck history lszlog last cephadmzmgr dumpzmgr metadataz mgr module lszmgr serviceszmgr statzmgr versionszceph orch status�statusr )zorch host lszorch device lszorch lszorch ls --exportzorch pszorch status --detailzorch upgrade status)zconfig diffzconfig showzcounter dumpzcounter schemaZ dump_cacheZ dump_mempoolsZdump_osd_networkZmds_requestsZmds_sessionsZobjecter_requestsz perf dumpzperf histogram dumpzperf histogram schemazperf schemar �version� z /var/run/cephz"/var/log/ceph/(.*/)?ceph-mgr.*.logZceph_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*c S s g | ]}d |� ��qS )�ceph � ��.0�cmdr r �?/usr/lib/python3.9/site-packages/sos/report/plugins/ceph_mgr.py� <listcomp>� � z!CephMGR.setup.<locals>.<listcomp>c S s g | ]}d |� d��qS )r z --format json-prettyr r r r r r � r Zjson_output)Zsubdirc s&