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.
Characteristics
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 and follow the instructions to install it simply by using the following commands:
# 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; "class=" Fit-image "src=" Http://s9.51cto.com/wyfs02/M00/2F/AF/wKiom1Og_ Xvgroggaadetzu58vi300.jpg "width=" 498 "style=" border:0px; "/>
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: The 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:
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 "Savage Power" blog, please be sure to keep this source http://chenfei123.blog.51cto.com/1427669/1746244
Dstat monitoring Tool under Linux terminal