[Reprint System Eye! Linux system performance monitoring tools Glances

System Eye! Linux system performance monitoring tools Glances

Posted on February 27   about 12 minutes 

A, Glances Introduction

glances python language development is based, may provide the functionality to monitor and analyze the performance data for performance UNIX or linux. glances display important system information on the user's terminal, and dynamically updated, real-time control allows administrators to use system resources, and dynamically monitor and does not consume large amounts of system resources such as CPU resources, typically consume less than 2% , glances default data is updated once every two seconds. Meanwhile glances can also capture the same data to a file for later analysis and reporting easy for graphics rendering, supported file formats and .csv spreadsheet format and html format.

github Address: HTTPS: //github.com/nicolargo / ...

Function glances tools are as follows:

  • CPU usage
  • Memory Usage
  • Kernel statistics and run queue information
  • Disk I / O speed, and transmit the read / write ratio
  • Disk Adapter
  • Network I / O speed, and transmit the read / write ratio
  • Page monitor
  • Process monitoring - consume the most resources processes
  • Computer information systems and resources

Renderings

Two, glances installation

  • Source Installation
  • pip install command
  • yum install

Source installation is more complex, you may encounter problems depend not been resolved; pip yum install to install and can be selected. Documentation Manuals: HTTPS: //glances.readthedocs.i ...

Third, the installation glances

Glances general has been integrated into the official repositories of most Linux distributions, you can use the direct system's package manager (such as apt-get, yum) to install:

sudo apt-get install glances
yum install epel* -yyum -y install glances

Course also be used Python package manager (PIP command) installation:

pip install glances

Temperature monitoring tools installed

lm_sensors software can help us to monitor the motherboard, CPU operating voltage, fan speed, temperature and other data. These data usually we can see in the motherboard BIOS. When we can run the machine through lm_sensors at any time to monitor the temperature of the CPU, because the CPU can be prevented Oh protection overheating will burn. lm_sensors software to monitor data can be recalled and displayed _ glances. _

yum -y install lm_sensors

In fact, these open-source software installation is very simple, basic 100% fool, nothing much of a problem.

Four, Glances of use


Glances There are four color-coded, represent different degrees of urgency:

  • Green: OK
  • Blue: CAREFUL
  • Purple: WARNING
  • Red: CRITICAL
Green represents a good performance; (At this time the CPU usage, disk space usage and memory usage is less than 50%, the system load is less than 0.7).

Blue represents the performance of the system there are some small problems, users should be concerned about system performance; (and the CPU usage, disk space usage and memory usage between 50% -70%, the system load between 0.7-1) .

Magenta indicates alarm performance, measures should be taken such as backup data; (At this time the CPU usage, disk space usage and memory usage is between 70% -90% between 1 and 5,, the system load).

Red represents a serious performance problem, may freeze; (At this time the CPU usage, disk space usage and memory usage is greater than 90%, the system load is greater than 5).

glances use


glances is a command-line tool command options include the following:

  • -b: Displays the network connection speed Byte / sec
  • -B @IP | host: bind the server IP address or host name
  • -c @IP | host: the server-side connection glances
  • -C file: Set the default configuration file is /etc/glances/glances.conf
  • -d: close the disk I / O modules
  • -e: Display sensor temperature
  • -f file: Set the output file (format is HTML or CSV)
  • -m: Close mounted disk module
  • -n: closed network module
  • -p PORT: The default port is set to run 61 209
  • -P password: Set a client / server password
  • -s: Set glances operating mode for the server
  • -t sec: setting screen refresh interval, in seconds, default is 2 seconds, the value range: 1 to 32767
  • -h: displays help information
  • -v: Displays version information

DESCRIPTION glances worksurface: 
an upper portion in the drawing is a CPU, Load (load), Mem (memory usage), Swap (swap) usage. In the upper portion of the figure is a network interface, Processes (process) usage. Typically comprises the following fields:

  • VIRT: virtual memory size
  • RES: the value of physical memory occupied by the process
  • % CPU: the process consumes CPU usage
  • % MEM: The percentage occupied by the process of physical memory and total memory
  • PID: Process ID number
  • USER: User name of the process owner
  • TIME +: Total CPU time the process started after the occupation of
  • Read and write I / O rate process: IO_R and IO_W
  • NAME: Process Name
  • NI: process priority
  • S: Process state, where S represents the sleep, R represents a running, Z represents a dead state.

Further glances can run the interactive tool, the user can use the following shortcut keys:

  • h: Displays help information
  • q: leave the program exits
  • c: Real-time CPU load on the system in accordance with the process of sorting
  • m: sorting process in accordance with the system memory usage
  • i: sorting process in accordance with the system I / O usage
  • p: sort by process name
  • d: Displays disk read and write status
  • w: delete the log files
  • l: Show log
  • s: Sensor Information Display
  • f: Information Display System
  • 1: shows the usage of each turn CPU core

Five, Glances of C / S mode

glances also supports C / S mode monitoring, monitored machine running the server, run the client-side monitoring remote monitoring both ends are installed Glances service can be.

Start the server

The service uses the default port is 61209, the start command as follows:

glances -s -B 192.168.1.253glances server is running on 192.168.1.253:61209

Client Access

glances -c 192.168.1.253

You can also use the user name and password to access the default user name is glances, if you want to change, then you can use --username be replaced. The following is the official text:

In client/server mode, limits are set by the server side.

You can set a password to access to the server using the --password. By default, the username is glances but you can change it with --username.

glances -s --usernameDefine the Glances server username: testDefine the Glances serverpassword (test username):Password (confirm):Do you want to save the password? [Yes/No]: YesGlances XML-RPC server is running on 0.0.0.0:61209

Client connection is as follows:

glances -c 192.168.1.253 --username test

Six, Glances of WebServer mode


In the glances of WebServer mode, the client only browser access can get a remote server running. Only you need to install the Python Bottle modules:

pip install bottle

After successful installation, use the glances -wcommand to open the WebServer mode. 
The client uses a browser to access http://SERVER_IP:61208/into the monitoring interface.

It WEB mode can also be seen in the phone, as shown below.

Sources of official documents

Seven other advanced applications

Exporting CSV format data, the following command:

glances --export-csv /tmp/1.csv

glances may also, in conjunction with open source software InfluxDB Grafana together to construct a platform for monitoring, and other monitoring software, capable of forming a real-time graph of the data.

Interested friends can play in a test environment, a good, powerful tools.

Do you have any useful performance tools?

Welcome messages to share exchange under together!

Guess you like

Origin www.cnblogs.com/jinanxiaolaohu/p/12375604.html