In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Omnipotent system monitoring tool dstat
Dstat is a versatile product that replaces commands such as vmstat,iostat,netstat and ifstat. Dstat overcomes the limitations of these commands and adds some additional features, monitoring items, and flexibility. Dstat makes it easy to monitor system health and use it for benchmarking and troubleshooting.
Dstat allows you to see all system resources in real time, for example, you can compare disk utilization by counting the current state of the IDE controller, or directly through network bandwidth values to compare disk throughput (at the same time interval).
Dstat will provide you with option information in the form of a list and clearly tell you in what magnitude and unit the output is displayed. In this way, information confusion and misinformation can be better avoided. More importantly, it makes it easier for you to write plug-ins to collect the data you want and extend it in a way that has never been done 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 them into Gnumeric or Excel generated tables.
Characteristics
Combined with vmstat,iostat,ifstat,netstat and more information, real-time display statistics can be written in python by enabling monitoring items and sorting modular design when analyzing and troubleshooting. It is more convenient to expand existing tasks, easy to expand and add your counters (please contribute to this). Many extensions included fully demonstrate that adding new monitoring items is very convenient to group statistical block devices / network devices. The total number can show the current state of each device with extremely accurate time accuracy, even if the system load is high, it will not delay the display of accurate units and limit the conversion error range to display different units with different colors to display the intermediate results with a delay of less than 1 second. support to output CSV format reports, and can be imported to Gnumeric and Excel to generate graphics.
Installation method
1. You can yum-y instatll dstat under centos
2. Download the rpm package for installation
Wget http://packages.sw.be/dstat/dstat-0.7.2-1.el5.rfx.noarch.rpmrpm-ivh dstat-0.7.2-1.el5.rfx.noarch.rpm
Usage
The basic use of dstat is to enter the dstat command, and the output is as follows:
This is the information displayed by the default output:
By default, there are five areas:
1.-- total-cpu-usage---- CPU utilization
Usr: percentage of programs in user space
Sys: percentage of system space programs
Idel: percentage idle
Wai: the percentage consumed by waiting for disk Imax O
Hiq: hard interrupt count
Siq: number of soft interrupts
2.-dsk/total- disk statistics
Read: total number of reads
Writ: total number of writes
3.-net/total- network statistics
Recv: total number of packets received on the network
Send: total number of packets sent on the network
4. Paging-- memory paging statistics
In: pagein (swap in)
Out:page out (swap out)
Note: paging activity of the system. Paging refers to a memory management technology used to find system scenarios. A larger page indicates that the system is using a lot of swap space. Usually, when the system has started to use swap space, it means that your memory is running out, or memory is very scattered. Ideally, the values of page in and page out are 0.
5.-- system-- system information
Int: number of interrupts
Csw: context switching
Note: interrupt (int) and context switch (csw). This statistic makes sense only when there is a comparative baseline. The higher statistics in this column usually indicate that a large number of processes are causing congestion and require attention to CPU. Your server will normally run some programs, so this item always displays some values.
By default, dstat will refresh the data every other second, refresh and output all the time, press Ctrl+C to exit "dstat"
Dstat also has many specific parameters, which can be viewed through the man dstat command
The common parameters are as follows:
You can view all the parameters that can be used by dstat through dstat-- list
-l: display load statistics-m: display memory usage (including used,buffer,cache) Free value)-r: show TCP O statistics-s: show swap partition usage-t: display current time on the first line-fs: display file system statistics (including total number of files and inodes values)-nocolor: do not display colors (sometimes useful)-socket: display network statistics-tcp: show commonly used TCP statistics-udp: show some dynamic data about the monitored UDP interface and its current usage
Of course, more than these uses, dstat comes with a number of plug-ins that greatly expand its functionality. You can check out some of their uses by looking at the / usr/share/dstat directory, some of which are commonly used:
-- disk-util: show disk busy status at a certain time-- freespace: show current disk space utilization-- proc-count: show the number of programs running-- top-bio: point out the largest process of block CPU O-- top-cpu: graphically show the process with the largest CPU usage-- top-io: show the process with the largest amount of memory consumed by normal iUnip O-- top-mem: show the process with the most memory.
Application examples:
Dstat output default monitoring, the interval between report output is 3 seconds, and 10 results are output in the report.
# dstat 3 10
See who is using all the memory:
# dstat-g-l-m-s-top-mem
Displays some data about CPU resource depletion:
# dstat-c-y-l-- proc-count-- how does top-cpu output a csv file # dstat-- output / tmp/sampleoutput.csv-cdn
Note: the output csv file can be opened with excel under windows and generate charts.
Summary
The above is the detailed explanation of the example of the Linux omnipotent system monitoring tool dstat introduced by the editor. I hope it will be helpful to you. If you have any questions, please leave me a message and the editor will reply to you in time. Thank you very much for your support to the website!
If you think this article is helpful to you, you are welcome to reprint it, please indicate the source, thank you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.