Glances of Linux network commands (11)

Source: Internet
Author: User
Tags cpu usage

First, glances use

1. Introduction

Glances is an open source command line system Monitoring tool for Linux and BSD, which is developed using the Python language to monitor CPU, load, memory, disk I/O, network traffic, file system, system temperature and more. This article describes the usage and techniques of glances to help Linux system administrators understand server performance.


2. Features

Glances can provide Unix and Linux performance experts with the ability to monitor and analyze performance data, including:

  • CPU usage

  • Memory usage

  • Kernel statistics and running queue information

  • Disk I/O speed, transmission, and read/write ratios

  • Free space in the file system

  • Disk Adapter

  • Network I/O speed, transmission, and read/write ratios

  • Page space and page speed

  • The process that consumes the most resources

  • Computer Information and system resources

The Glances tool can display important system information in real time on the user's terminal and update it dynamically. This efficient tool can work on any terminal screen. In addition, it does not consume a lot of CPU resources, usually less than 2%. The glances displays the data on the screen and updates it every two seconds. You can also change this time interval to a value that is longer or shorter. The Glances tool can also capture the same data to a file for later analysis and drawing of the report. The output file can be in the form of a spreadsheet (. csv) or HTML format.


3. Common options

-B: Show Network connection speed byte/sec

-B @IP |host: Bind server-side IP address or host name

-C @IP |host: Connect glances server Side

-C File: Set profile default is/etc/glances/glances.conf

-D: Turn off the disk I/O module

-E: Display sensor temperature

-F file: Set output files (in HTML or CSV format)

-M: Close mounted disk module

-N: Shut down the network module

-P Port: Set the Run port by default is 61209

-p Password: setting client/server password

-S: Set glances run mode to server

-T sec: Sets the time interval for the screen refresh, in seconds, and the default value of 2 seconds, value License range: 1~32767

-H: Display Help information

-V: Display version information


4. Installation

Because glances is in the Epel source, you need to install the Epel source before you can install glances.

[email protected] ~]# yum install-y epel-release[[email protected] ~]# yum install-y glances


5. Instructions for use

Glances working interface such as:

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/7D/48/wKiom1bkOofxlaO3AADEF2TMXng173.png "title=" 1.png " alt= "Wkiom1bkoofxlao3aadef2tmxng173.png"/>

Description of the Glances working interface:

In the upper part is CPU, load (load), Mem (memory use), swap (swap partition) usage. In the upper part of Figure 1 is the usage of the network interface, Processes (process). Typically, the following fields are included:

  • VIRT: Virtual Memory size

  • RES: The physical memory value that the process occupies

  • %CPU: CPU usage consumed by this process

  • %MEM: The percentage of physical memory and total memory that the process occupies

  • PID: Process ID number

  • User: Username for process Owner

  • time+: Total CPU Time after the process is started

  • Io_r and Io_w: Read/write I/O rate for processes

  • Name: Process names

  • NI: Process Priority

  • S: Process state, where S indicates hibernation, R is running, and Z indicates zombie state.


In addition glances can run the tool interactively, and users can use the following shortcut keys:

  • H: Display Help information

  • Q: Leave the program to exit

  • C: Sort system processes according to CPU real-time load

  • M: Sort system processes according to memory usage

  • I: Sort system processes according to I/O usage

  • P: Sort by process name

  • D: Show disk read and write status

  • W: Delete log file

  • L: Show Log

  • S: Display sensor information

  • F: Display System Information

  • 1: Turns on the usage of each CPU core (the secondary option is used only on multicore CPU systems)


Understanding system performance with glances output color:

    • Green indicates good performance without any additional work, (CPU usage, disk space usage, and memory usage below 50%, system load below 0.7).

    • Blue indicates that there are some minor problems with system performance, and users should begin to focus on system performance (CPU usage, disk space usage, and memory usage are between 50% and 70%, with a system load between 0.7 and 1).

    • Magenta indicates performance alarms and should take steps such as backing up data (CPU usage, disk space usage, and memory usage between 70% and 90%, with system load between 1-5).

    • Red indicates a serious performance problem and may be down, at which time CPU usage, disk space usage, and memory usage are greater than 90% and the system load is greater than 5.


Second, glances advanced use

1, let glances output HTML format file, first install the relevant software package

[email protected] ~]# yum install-y python-jinja2[[email protected] ~]# glances-o html-f/usr/share/nginx/html/


2. Browser testing

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/7D/46/wKioL1bkOzfCgG6aAABabwV_T8k813.png "title=" 2.png " alt= "Wkiol1bkozfcgg6aaababwv_t8k813.png"/>

3. Output CSV format

The file is formatted with a comma-separated value (CSV) and can be imported directly into a spreadsheet.

[Email protected] ~]# Glances-o csv-f/root/glances.csv


4, Glances server/client mode of operation

Environment Introduction:

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/7D/48/wKiom1bkOuCCsWWNAAAXKgD9lHA973.png "title=" 3.png " alt= "Wkiom1bkouccswwnaaaxkgd9lha973.png"/>

Client Installation glances:

[email protected] ~]# yum install-y epel-release[[email protected] ~]# yum install-y glances


Start at the server side first:

[[email protected] ~]# Glances-s-B 192.168.1.8Glances server started the 192.168.1.8:61209


You can see that the port number used by glances is 61209, so the user needs to make sure that the firewall is open. below, the client uses the following command to connect to the server such as:

[Email protected] ~]# glances-c 192.168.1.8

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M02/7D/48/wKiom1bkOwDgr1khAADD9mMrXHw908.png "title=" 4.png " alt= "Wkiom1bkowdgr1khaadd9mmrxhw908.png"/>

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/7D/46/wKioL1bkO6nT-jSUAABykoMNNqQ985.png "title=" 5.png " alt= "Wkiol1bko6nt-jsuaabykomnnqq985.png"/>




This article is from the "Bread" blog, make sure to keep this source http://cuchadanfan.blog.51cto.com/9940284/1750426

Glances of Linux network commands (11)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.