Linux under Glances Server monitoring tool

Source: Internet
Author: User
Tags gpg epel repo

Objective

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.

Back to top of page

Two methods of installing glances

There are usually two ways to install glances. The first is to compile the source code in such a way that this method is more complex and may encounter a package dependency problem. Another option is to use a specific package management tool to install glances, which is relatively straightforward. This article uses the latter, which needs to be described in the CentOS-specific package management tool to install. Glances to configure EPEL repo first, then install glances using the PIP tool.

Introduction to PIP Packages

Linux system administrators typically have two ways to install a Python package: one is to install from the system's software repository through the system's package management tools (such as Apt-get), one through Python's own package management tool (such as Easy_install or PIP) from the Py Download and install Thon Cheese Shop. I recommend using PIP. Pip is a tool for installing and managing Python packages in place of Easy_install, a handy tool for installing the Python library, similar to YUM. Note After installing PYTHON-PIP under CentOS and Fedora, the keyword is not pip but Pip-python.

First Configure EPEL Repo

If you want to get RHEL's high-quality, high-performance, high-reliability, and easy-to-use (key to free) package update functionality, Fedora Project launches EPEL (Extra Packages for Enterprise Linux, http://f Edoraproject.org/wiki/epel) Just right for you. It is a project built by the Fedora community to provide high-quality software packages for RHEL and derivative distributions such as CentOS, scientific Linux, and more. Loaded with EPEL, just like in Fedora, you can install the software by using Yum install Package-name. Installation using EPEL is simple:

#wget http://ftp.riken.jp/Linux/fedora/epel/RPM-GPG-KEY-EPEL-6  #rpm--import rpm-gpg-key-epel-6  #rm-F Rpm-gpg-key-epel-6  #vi/etc/yum.repos.d/epel.repo  # Create New  [EPEL]  Name=epel RPM Repository for Red Hat Enterprise Linux  baseurl=http://ftp.riken.jp/linux/fedora/epel/6/$basearch/  gpgcheck=1  Enabled=0
Installing glances with PIP

Here's the installation process: First use YUM to install the PIP tool, and then use the PIP tool to install the glances and related software to display the system temperature.

#yum--enablerepo=epel Install Python python-pip python-devel gcc  # Pip-python Install glances
Installing Lm_sensors Software

Lm_sensors software can help us to monitor the motherboard, CPU operating voltage, fan speed, temperature and other data. These data are usually also visible in the BIOS of the motherboard. When we can monitor the temperature change of the CPU at any time when the machine is running, we can prevent the lm_sensors from burning because the CPU is overheating. The data that the Lm_sensors software monitors can be called and displayed by glances .

# yum Install lm_sensors  # Pip-python Install Pysensors

Back to top of page

Glances how to use
Glances is a command-line tool that includes the following command 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-C file: Set profile default Yes/etc/glances/glances.conf  -D: Turn off disk I/O module-e: Display sensor temperature-F file: Set output file (format is HTML or CSV)-m: Close mounted Disk module-N: Shut down network module-P PORT: Set Run port default is 61209-  p password: Set client/server password-S: Set glances run mode for server-T sec: Set screen refresh interval in seconds, default value is 2 seconds, value License range: 1~32767  - H: Display Help Information-V: Display version information

Glances working interface 1

Figure 1.glances Working interface

Description of the Glances working interface:
At the top of Figure 1 is the usage of the CPU, load (payload), Mem (memory use), swap (swap partition). 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 amount of physical memory that the process consumes%CPU: The CPU usage that the process consumes%MEM: the percentage of physical memory and total memory used by the process PID: Process ID Number User: The process Owner's username time+: The total C that is occupied after the process is started PU time Io_r and io_w: Read/write I/O rate of the process name: process names NI: Process priority s: Process state, where S indicates hibernation, R is running, and Z indicates zombie state.

In the lower-middle part of Figure 1 is the CPU temperature detected by the sensor. The lower part of Figure 1 is the usage of disk I/O. In addition glances can run the tool interactively, and users can use the following shortcut keys:

H: Show help information Q: Leave program exit C: Sort system process by CPU real-time load m: Sort system process by memory usage I: Sort system process by I/O usage P: Sort by process name D: Show Disk read and write status  w: Delete Day Log file L: Display logs S: Display sensor information F: Display System Information 1: Rotate each CPU core usage (secondary option only used on multicore CPU system)

Back to top of page

Glances's advanced application Glances results output method

Let glances output HTML format file, first install related package

# Pip-python Install Jinja2  # glances-o Html-f/var/www/html

Below you can enter the URL using the Firefox browser: http://localhost/glances.html, result 2.

Figure 2. Output HTML Format file

Output CSV format

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

# Glances-o Csv-f/home/cjh/glances.csv

Below, use the LibreOffice Calc tool to open the CSV format file (3)

#libreoffice--calc%u/tmp/glances.csv
Figure 3. Open the CSV format file using the LibreOffice Calc Tool

Glances how the server/client works

The glances supports server/client mode of operation, which enables remote monitoring. First, assume

Server IP Address: 10.0.2.14

Client IP Address: 10.0.2.15

Make sure both of the glances packages are installed.

First start on the server side;

# glances-s-B 10.0.2.15  glances server is running on 10.0.2.15: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 server 4:

# glances–c 10.0.2.15
Figure 4: Client Connection server

Note that the lower-left corner of Figure 4 shows "Connected to 10.0.2.15" > indicates that the client has successfully connected to the server.

Understanding system performance by glances output color 5. is an output interface of glances

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.

Linux under Glances Server monitoring tool

Related Article

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.