Файловый менеджер - Редактировать - /usr/lib/python3.9/site-packages/glances/__pycache__/main.cpython-39.opt-1.pyc
Назад
a ���c�n � @ s� d Z ddlZddlZddlZddlmZmZ ddlmZm Z m Z mZ ddlm Z ddlmZ ddlmZ ddlmZmZ G d d � d e�ZdS )zGlances main class.� N)�__version__�psutil_version)�input�disable�enable�PY3)�Config)�WINDOWS)�sort_processes_key_list)�logger�LOG_FILENAMEc @ s� e Zd ZdZdZdZdZdZdZdZ dZ d Zd d� Zdd � Z dd� Zdd� Zdd� Zdd� Zdd� Zdd� Zdd� Zdd� Zdd� Zd%d d!�Zd&d"d#�Zd$S )'�GlancesMainz&Main class to manage Glances instance.� � Fi� i� �glances� a� Examples of use: Monitor local machine (standalone mode): $ glances Display all Glances modules (plugins and exporters) and exit: $ glances --module-list Monitor local machine with the Web interface and start RESTful server: $ glances -w Glances web server started on http://0.0.0.0:61208/ Only start RESTful API (without the WebUI): $ glances -w --disable-webui Glances API available on http://0.0.0.0:61208/api/ Monitor local machine and export stats to a CSV file (standalone mode): $ glances --export csv --export-csv-file /tmp/glances.csv Monitor local machine and export stats to a InfluxDB server with 5s refresh rate (standalone mode): $ glances -t 5 --export influxdb Start a Glances XML-RPC server (server mode): $ glances -s Connect Glances to a Glances XML-RPC server (client mode): $ glances -c <ip_server> Connect Glances to a Glances server and export stats to a StatsD server (client mode): $ glances -c <ip_server> --export statsd Start the client browser (browser mode): $ glances --browser Display stats to stdout (one stat per line, possible to go inside stats using plugin.attribute): $ glances --stdout now,cpu.user,mem.used,load Display JSON stats to stdout (one stats per line): $ glances --stdout-json now,cpu,mem,load Display CSV stats to stdout (all stats in one line): $ glances --stdout-csv now,cpu.user,mem.used,load Enable some plugins disabled by default (comma separated list): $ glances --enable-plugin sensors Disable some plugins (comma separated list): $ glances --disable-plugin network,ports Disable all plugins except some (comma separated list): $ glances --disable-plugin all --enable-plugin cpu,mem,load c C s | � � | _dS )z"Manage the command line arguments.N)� parse_args�args��self� r �0/usr/lib/python3.9/site-packages/glances/main.py�__init__` s zGlancesMain.__init__c C s� d� ttt�}tjddtj| jd�}|jddd|d� |jd d ddd dd� |jddddd� |jddddddd� |jddddd� |jdddd d� |jd!ddd"d#d� |jd$ddd%d&d� |jd'd(ddd)d*d� |jd+d,ddd-d.d� |jd/d0ddd1d2d� |jd3d4ddd5d6d� |jd7d8ddd9d:d� |jd;d<ddd=d>d� |jd?d@dddAdBd� |jdCdDdddEdFd� |jdGdddHdId� |jdJdddKdLd� |jdMdddNdOd� |jdPdddQdRd�f |jdSdddTdUd� |jdVdWdddXdYd�f |jdZd[t d\� d]� t ��d^� |jd_d`dddadbd� |jdcddded� |jdfdgdhdidj� |jdkdddldmd� |jdndodpdqdj� |jdrt�� dsdtdj� |jdudvdwdxd� |jdydzddd{d|d� |jd}ddd~dd� |jd�ddd�d�d� |jd�d�d�t d�d�� | j�d�� |jd�d�d�d�d�dj� |jd�ddd�d�d� |jd�ddd�d�d� |jd�d�d�d� |jd�d�d�d�dj� |jd�d�t d�d�d�� |jd�d�d�d�dj� |jd�d�d�d�dj� |jd�d�d�d�dj� |jd�ddd�d�d� |jd�d�| jtd�d�� | j�d�� |jd�d�ddd�d�d� |jd�| jt d�d�� | j�d�� |jd�d�t d�d�d�� |jd�ddd�d�d� |jd�d�ddd�d�dÍ |jd�d�d�td�d�d�� |jd�dd�d�d�d� |jd�d�dd�d�d� |jd�d�d�d�dj� |jd�d�d�d�dj� |jd�d�d�d�dj� |jd�d�dd�d�dÍ |jd�ddd�d�dÍ |jd�ddd�d�dÍ |jd�d�dd�d�dÍ t�s|jd�ddd�d�d� |jd�d�ddd�d�d� |jd�ddd�d�d� |jd�ddd�d�d� |jd�ddd�d�d� |jd�ddd�d�d� |jd�ddd�d�d� |jd�ddd�d�d� |jd�ddd�d�d� |j�d dd�d�dd� |j�d�d�d�d�d� |S ( z$Init all the command line arguments.z(Glances v{} with PsUtil v{} Log file: {}r �resolve)�prog�conflict_handler�formatter_class�epilogz-Vz --version�version)�actionr z-dz--debug� store_trueF�debugzenable debug mode)r �default�dest�helpz-Cz--config� conf_filezpath to the configuration file)r# r$ z--modules-listz --module-listZmodules_listz1display modules (plugins & exports) list and exitz--disable-pluginz--disable-plugins�disable_pluginzidisable plugin (comma separated list or all). If all is used, then you need to configure --enable-plugin.z--enable-pluginz--enable-plugins� enable_pluginz$enable plugin (comma separated list)z--disable-processZdisable_processzdisable process modulez--disable-webuiZ disable_webuizdisable the Web Interfacez--lightz--enable-light�enable_lightz3light mode for Curses UI (disable all but top menu)z-0z--disable-irixZdisable_irixz<task's cpu usage will be divided by the total number of CPUsz-1z--percpuZpercpuzstart Glances in per CPU modez-2z--disable-left-sidebar�disable_left_sidebarz1disable network, disk I/O, FS and sensors modulesz-3z--disable-quicklookZdisable_quicklookzdisable quick look modulez-4z--full-quicklook�full_quicklookz#disable all but quick look and loadz-5z --disable-top�disable_topz.disable top menu (QL, CPU, MEM, SWAP and LOAD)z-6z --meangpuZmeangpuzstart Glances in mean GPU modez--disable-history�disable_historyzdisable stats historyz--disable-boldZdisable_boldz!disable bold mode in the terminalz--disable-bgZ disable_bgz)disable background colors in the terminalz--enable-irqZ enable_irqzenable IRQ modulez--enable-process-extendedZenable_process_extendedz$enable extended stats on top processz--separatorz--enable-separatorZenable_separatorzenable separator in the UIz--sort-processesZsort_processes_keyzSort processes by: {}z, )r# �choicesr$ z --programsz --programZprogramszAccumulate processes by programz--export�exportz+enable export module (comma separated list)z--export-csv-filez ./glances.csvZexport_csv_filezfile path for CSV exporter)r"