Server IP : 184.107.3.203 / Your IP : 216.73.216.51 Web Server : Apache System : Linux dedicated2.avenfashion.com.ph 4.18.0-553.40.1.el8_10.x86_64 #1 SMP Mon Feb 10 12:11:18 EST 2025 x86_64 User : adminteladeoro ( 1015) PHP Version : 8.2.28 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0755) : /usr/lib/python3.6/site-packages/sos/report/__pycache__/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
3 ~ �g�= � @ sL d dl Z d dlZd dlZd dlZd dlZd dlZd dlZd dlmZ d dlZd dl m Z d dl mZ d dl mZ d dlZd dlmZmZmZmZmZmZmZ d dlmZ d dlmZ d d lmZ d dlZd d lm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z) d dl*m+Z+ d dl,m-Z- ej.ej/fZ0ddd�Z1dd� Z2dddgZ3G dd� de�Z4dS )� N)�datetime)�ThreadPoolExecutor)�TimeoutError)�rmtree)�ImporterHelper�SoSTimeoutError�bold�sos_get_command_output�TIMEOUT_DEFAULT�listdir� is_executable)�_sos)�__version__)�SoSComponent) �Report�Section�Command� CopiedFile�CreatedFile�Alert�Note�PlainTextReport� JSONReport� HTMLReport)� SoSCleaner)� SoSUploadF�, c C s� g }| }|rt | �d }nd}xB|D ]:}t |�t |� t |� dkrR|j|� |}|| | }q$W |t |� d � |kr�|d t |� � }|j|� |S )N� � �H )�len�append)Z first_line�items�indent�sep�lines�line�newline�item� r) �/usr/lib/python3.6/__init__.py�_format_list. s r+ c C s t j| d�d�S )z� This function will format --since arg to append 0s if enduser didn't. It's used in the _get_parser. This will also be a good place to add human readable and relative date parsing (like '2 days ago') in the future z<014sz%Y%m%d%H%M%S)r Zstrptime)Zdater) r) r* � _format_since@ s r, �auto�alwaysZneverc ? s� e Zd ZdZdZdZdddddddddg g g dddg dg dg ddddd dd g g g ddddddg deeg dddg dddddddddddddddddd�>Z� fdd �Ze dd� �Z e dd� �Zdd� Zdd� Z dd� Zdd� Zdd� Zdd� Zdd� Zd d!� Zd"d#� Zd�d$d%�Zd&d'� Zd(d)� Zd*d+� Zd,d-� Zd.d/� Zd0d1� Zd2d3� Zd4d5� Zed6d7� �Zd�d8d9�Z d:d;� Z!d<d=� Z"d>d?� Z#d@dA� Z$dBdC� Z%dDdE� Z&d�dGdH�Z'dIdJ� Z(dKdL� Z)dMdN� Z*dOdP� Z+dQdR� Z,dSdT� Z-dUdV� Z.dWdX� Z/dYdZ� Z0d[d\� Z1d]d^� Z2d�d_d`�Z3dadb� Z4dcdd� Z5dedf� Z6dgdh� Z7didj� Z8dkdl� Z9dmdn� Z:dodp� Z;dqdr� Z<dsdt� Z=dudv� Z>dwdx� Z?dydz� Z@d{d|� ZAd}d~� ZBdd�� ZCd�d�� ZDd�d�� ZEd�d�� ZFd�d�� ZGd�d�� ZH� ZIS )�� SoSReportzaRun a set of commands and file collections and save them to a report for future analysis z.Collect files and command output in an archiveTFr r- �d N� z /etc/sos/cleaner/default_mapping)>� alloptions�all_logs�build�case_id�chroot�clean�container_runtime�keep_binary_files�desc�domains�disable_parsers�skip_cleaning_filesZdry_run� estimate_only�experimental�enable_plugins�journal_size�keywords�keyword_file�plugopts�label�list_plugins�list_presets� list_profiles�log_sizeZlow_priority�map_file� skip_commands� skip_files�skip_plugins� namespaces� no_report�no_env_vars�no_postproc� no_update�note�only_plugins�preset�plugin_timeout�cmd_timeout�profiles�since�verify�allow_system_changes� usernames�upload� upload_urlZupload_directoryZupload_userZupload_passZ upload_methodZupload_no_ssl_verifyZupload_protocol�upload_s3_endpointZupload_s3_regionZupload_s3_bucketZupload_s3_access_keyZupload_s3_secret_keyZupload_s3_object_prefixZ upload_target� add_preset� del_presetc s t � j|||� g | _g | _g | _t� | _|| _d| _i | _ | j � | j� | jj � | _| jjjd�| _| j� d}| jj| _| jjr�d}n| jj� r�| jtjkr�d}| jjd| j� d|� d�� | jjtk�r| jjd | jj� �� tj� | jj � | j!d � | j"� | j#� | j$� d S )N�/�report�default�cmdline�policyzset sysroot to 'z' (�)zinvalid chroot mode: � )%�super�__init__�loaded_plugins�skipped_plugins�all_options�set�env_varsZ_args�sysroot�estimated_plugsizes�print_header� _set_debugrf Zis_rootZ_is_root�manifestZ components�add_section� report_md�_set_directories�optsZin_container�osr$ �soslog�debugr6 �chroot_modes�error�logging�shutdown� tempfile_utilr7 �_exit�_check_container_runtime�_get_namespaces�_get_hardware_devices)�self�parser�argsre �msg)� __class__r) r* rj � s8 zSoSReport.__init__c C s� |j dd�}|jddddddd � |jd ddddd � |jd ddd tdd� |jdddddd � |jddddd� |jddddddd � |jdddd � |jd!d"tdd#d$d%� |jd&dd'd(� |jd)dd*d(� |jd+dd,dd-d � |jd.d/d0d1td2g d3� |jd4td5d6d7d8� |jd9d:d;d0d<td=g d3� |jd>d?dd@dAd� |jdBdCddDddEd � |jdFddGd(� |jdHddIddJd � |jdKddLtdMdNdO� |jdPdddQdR� |jdSd dTd � |jdUdVd0dWtdXg d3� |jdYddZdd[d � |jd\dd]dd^d � |jd_dd`ddadb� |jdctdd#ddd%� |jdedfd0dgtdhg d3� |jdidtdjddk� |jdld dmd � |jdnd dod � |jdpdqdrd0dstg dtdO� |jdug d0dvdwdx� |jdyg d0dzd{dx� |jd|dd}dd~d � |jddd�dd�d � |jd�ddd�dR� |jd�d d�d � |jd�d d�d � |jd�d d�d � |jd�d d�d � |jd�ddd�d�gd�d�� |jd�ddd�d�� |jd�d d�d � |jd�d d�d � |jd�d d�d � |jd�d d�d � |jd�d d�d � |jd�d d�d � |jd�ddd�d�d�d�gd�d�� |j� }|jd�tdd�d�� |jd�tdd�d�� |j d�d��}|jd�d�d�d�ddd�d�� |jd�d�g d0d�d�� |jd�d0g d�d�d�� |jd�d�d0g d�d�d�� |jd�d0g d�d�d�� |jd�d d�d�dč |jd�ddd�d�d�� |jd�d�d�d�d̍ |jd�ddd�d�dx� |jd�d�g d0d�d�� d S )�NzReport Optionsz.These options control how report collects dataz-az--alloptions� store_truer2 Fz%enable all options for loaded plugins)�action�destrd �helpz --all-logsr3 z-collect all available logs regardless of sizez--sinceZstorerY zbEscapes archived files older than date. This will also affect --all-logs. Format: YYYYMMDD[HHMMSS])r� r� rd �typer� z--buildr4 z;preserve the temporary directory and do not package resultsz --case-idr5 zspecify case identifier)r� r� r� z-cz--chrootr6 r- zHchroot executed commands to SYSROOT [auto, always, never] (default=auto)z--container-runtimezLDefault container runtime to use for collections. 'auto' for policy control.)rd r� z--descz --descriptionr zDescription for a new preset)r� r� rd r� z --dry-runz#Run plugins but do not collect data)r� r� z--estimate-onlyzzApproximate disk space requirements for a real sos run; disables --clean and --collect, sets --threads=1 and --no-postprocz--experimentalr? zenable experimental pluginsz-ez--enable-plugins�extendr@ zenable these plugins)r� r� r� r� rd z--journal-sizer0 rA z+limit the size of collected journals in MiB)r� rd r� r� z-kz--plugin-optionz --plugoptsrD z7plugin options in plugname.option=value format (see -l)z--labelz--namerE z"specify an additional report labelz-lz--list-pluginsrF z)list plugins and available plugin optionsz--list-presetsz#display a list of available presetsz--list-profilesrH zBdisplay a list of available profiles and plugins that they includez --log-sizerI r1 z6limit the size of collected logs (not journals) in MiB)r� r� r� rd r� z--low-priorityz(generate report with low system priority)r� rd r� z--namespaceszDlimit number of namespaces to collect output for - 0 means unlimitedz-nz--skip-pluginsrM zdisable these pluginsz--no-reportrO z disable plaintext/HTML reportingz --no-env-varsrP z$Do not collect environment variablesz --no-postprocrQ zDisable all post-processing)rd r� r� r� z--notezBehaviour notes for new presetz-oz--only-pluginsrT zenable these plugins onlyz--presetzA preset identifier)r� r� r� rd z--plugin-timeoutzset a timeout for all pluginsz --cmd-timeoutz%set a command timeout for all pluginsz-pz --profilez --profilesrX z)enable plugins used by the given profilesz--skip-commandsrK zdo not execute these commands)rd r� r� r� z--skip-filesrL zdo not collect these filesz--verifyrZ z+perform data verification during collectionz--allow-system-changesr[ zJRun commands even if they can change the system (e.g. load kernel modules)z--uploadz+Upload archive to a policy-default locationz--upload-urlz&Upload the archive to specified serverz--upload-directoryz$Specify upload directory for archivez --upload-userz'Username to authenticate to server withz --upload-passz'Password to authenticate to server withz--upload-methodZputZpostz HTTP method to use for uploading)rd �choicesr� z--upload-no-ssl-verifyz'Disable SSL verification for upload url)rd r� r� z--upload-s3-endpointz#Endpoint to upload to for S3 bucketz--upload-s3-regionz!Region to upload to for S3 bucketz--upload-s3-bucketz"Name of the S3 bucket to upload toz--upload-s3-access-keyzAccess key for the S3 bucketz--upload-s3-secret-keyzSecret key for the S3 bucketz--upload-s3-object-prefixzPrefix for the S3 object/keyz--upload-protocolZhttpsZftpZsftpZs3z$Manually specify the upload protocolz--add-presetz#Add a new named command line preset)r� r� r� z--del-presetz$Delete the named command line presetzCleaner/Masking Optionsz7These options control how data obfuscation is performedz--cleanz --cleanerz--maskr7 zObfuscate sensitive information)r� rd r� r� z --domainsr; z$Additional domain names to obfuscatez--disable-parsersr<