Dstat monitoring tool under Linux Terminal

Source: Internet
Author: User
Tags memory usage cpu usage

Dstat is a versatile product that can replace Vmstat,iostat,netstat and Ifstat commands. Dstat overcomes the limitations of these commands and adds additional functionality, increasing the number of monitoring items and becoming more flexible. The dstat can easily monitor system health and be used for benchmarking and troubleshooting.

Dstat allows you to see all of your system resources in real time, for example, by counting the current state of the IDE controller to compare disk utilization, or by comparing the throughput rate of the disk (at the same time interval) directly over the network bandwidth value.

Dstat will give you the option information in the form of a list and clearly tell you what the amplitude and unit display output is. This avoids information confusion and false positives better. More importantly, it makes it easier for you to write plug-ins to collect the data you want and expand it in ways you never had before.

The default output of Dstat is designed for people to view in real time, but you can also export details to a file via CSV and import it into a gnumeric or Excel generated table.

features
  • Combined with vmstat,iostat,ifstat,netstat and more information

  • Real-time display of statistics

  • When analyzing and troubleshooting, you can sort by enabling monitoring items

  • Modular design

  • Written in Python for easier extension of existing work tasks

  • Easily expand and add your counters (please contribute to this)

  • Many of the extensions that are included fully illustrate the convenience of adding new monitoring items

  • Statistics block devices/network devices can be grouped and the total number given

  • can display the current status of each device

  • Extremely accurate time accuracy, even if the system load is high, will not delay the display

  • Display accurate unit and limit conversion error ranges

  • Display different units in different colors

  • Show intermediate result delay less than 1 seconds

  • Supports output of CSV format reports and can be imported into Gnumeric and Excel to generate graphs

Installation Method

Ubuntu/mint and Debin Systems:

The local repositories have related installation packages that you can install with the following command:

# sudo apt-get install Dstat

Rhel/centos and Fedora Systems:

you can add a related installation package to the Romforge Software library, referencing Guide , it is easy to install with the following command:

# yum Install Dstat

ArchLinux System:

Related packages in the Community repository, you can use this command to install:

# pacman-s Dstat

How to use

The basic usage of dstat is to enter the Dstat command, and the output is as follows:

650) this.width=650; "Src=" https://dn-linuxcn.qbox.me/data/attachment/album/201406/17/224823h9y178x8jyro8uy3.png "Style=" border:none;margin:10px 5px; "/>

This is the information that the default output displays:

CPU status : CPU usage. The more interesting part of the report is the display of the user, the system, and the idle part, which better analyzes the current state of CPU usage. If you see the "Wait" column, the state of the CPU is a high usage value, which indicates that there are some other problems with the system. When the state of the CPU is "waits", it is because it is waiting for a response from the I/O device (such as memory, disk, or network) and has not yet received it.

Disk Statistics : Read and write operations on disk, this column shows the total number of read and write disks.

Network Statistics : Network devices send and receive data, this column shows the total number of network receipts and sends data.

paging statistics : Paging activity of the system. Paging refers to a memory management technique used to find a system scenario, a large paging indicates that the system is using a large amount of swap space, or that the memory is very fragmented, and in most cases you want to see the value of page in (swapped in) and page out (swapped out) to 0 0.

System Statistics : This item shows interrupts (int) and context switches (CSW). This statistic only makes sense when there are baseline comparisons. The higher statistics in this column usually indicate that a large number of processes are causing congestion and need to focus on the CPU. Your server will normally run some programs, so this always shows some values.

By default, Dstat refreshes the data every second. If you want to exit Dstat, you can press the "Ctrl-c" key.

It is important to note that the first line of the report, usually all the statistics here do not show the value.

This is because Dstat will give a summary through the last report, so the first run time is the data with no mean and total value.

However, Dstat can control the reporting interval and the number of reports by passing 2 parameters to run. For example, if you want to Dstat output default monitoring, the report output is 3 seconds apart, and the report outputs 10 results, you can run the following command:

Dstat 3 10

There are many parameters available in the Dstat command, which you can view with the Man Dstat command, and most of the commonly used parameters are:

  • -L: Display load statistics

  • -M: Show memory utilization (including Used,buffer,cache,free value)

  • -R: Show I/O statistics

  • -S: Show swap partition usage

  • -T: Displays the current time in the first row

  • –FS: Displays file system statistics (including total number of files and inodes values)

  • –nocolor: Color not displayed (sometimes useful)

  • –socket: Displaying network statistics

  • –TCP: Displaying commonly used TCP statistics

  • –UDP: Displays some dynamic data for the monitored UDP interface and its current usage

More than that, of course, Dstat comes with a few plugins that extend its functionality to a great extent. You can view some of their usage by looking at the/usr/share/dstat directory, which are commonly used:

  • -–disk-util: Displays the busy state of a time disk

  • -–freespace: Displays the current disk space utilization

  • -–proc-count: Shows the number of programs that are running

  • -–top-bio: Indicates the maximum block I/O process

  • -–TOP-CPU: Graphically displays the most CPU-intensive processes

  • -–top-io: Shows the most normal I/O processes

  • -–TOP-MEM: Show processes that occupy the most memory

Give some examples:

Display System load:

650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M00/97/02/wKioL1knz0WR0yJ-AAAuTLftL2c533.png "title=" D1.png "alt=" Wkiol1knz0wr0yj-aaautlftl2c533.png "/>

Show memory Usage:

650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M02/97/02/wKioL1knz36y8eUgAAA6tZfH3tE181.png "title=" D2.png "alt=" Wkiol1knz36y8eugaaa6tzfh3te181.png "/>

See who is occupying all of the memory:

Dstat-g-l-m-S--top-mem

Show some data about CPU resource loss:

Dstat-c-y-l--proc-count--top-cpu

How to output a CSV file

To export a file in CSV format for later, you can use the following command:

# DSTAT–OUTPUT/TMP/SAMPLEOUTPUT.CSV-CDN


This article is from the "Ant" Blog, please be sure to keep this source http://215687833.blog.51cto.com/6724358/1929833

Dstat monitoring tool under Linux Terminal

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.