All-round system monitoring tool dstat dstat is a multi-functional product that can replace the vmstat, iostat, netstat and ifstat commands. dstat overcomes the limitations of these commands and adds some additional features, increases monitoring items, and becomes more flexible. dstat is a handy tool for monitoring system health and can be used 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 status of IDE controllers, or compare disk throughput directly by network bandwidth values (in the same time interval). dstat will provide you with information about the options in a table format and clearly tell you in what range and units the output is displayed. This better avoids information confusion and false alarms. More importantly, it makes it easier for you to write plugins to collect the data information you want, extending it in ways that have never been possible before. Dstat's default output is designed for real-time viewing by humans, but you can also export the details to a CSV file and import it into Gnumeric or Excel to generate a table. characteristic
Installation Method 1. Under centos, you can yum -y instatll dstat 2. Download the rpm package for installation wget http://packages.sw.be/dstat/dstat-0.7.2-1.el5.rfx.noarch.rpm rpm -ivh dstat-0.7.2-1.el5.rfx.noarch.rpm How to use The basic usage of dstat is to enter the dstat command, and the output is as follows: This is what the default output shows: By default, there are five areas: 1. --total-cpu-usage----CPU usage usr: the percentage of programs in user space; sys: percentage of system space programs; idel: idle percentage; Wait: The percentage of time spent waiting for disk I/O; hiq: number of hard interrupts; 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 network packets received send: total number of network packets sent 4. ---paging-- Memory paging statistics in: pagein out: page out Note: System paging activity. Paging refers to a memory management technique used to find system scenarios. A larger page indicates that the system is using a large amount of swap space. Usually, when the system has started using swap space, it means that your memory is not enough, or the memory is very fragmented. Ideally, the values of page in and page out are 0 0. 5. --system--System information int: number of interruptions csw: context switch Note: interrupt (int) and context switch (csw). This statistic is only meaningful when there is a baseline for comparison. A high statistic in this column usually indicates that a large number of processes are causing congestion and that the CPU needs attention. Your server will usually be running some programs, so this item will always show some values. By default, dstat will refresh data every second, and keep refreshing and outputting data. Press Ctrl+C to exit "dstat"; dstat has many specific parameters, which can be viewed through the man dstat command. Common parameters are as follows: You can view all the parameters that dstat can use through dstat --list
Of course, there are more than just these uses. dstat comes with some plugins that greatly expand its functionality. You can view some of their usage by looking in the /usr/share/dstat directory. The commonly used ones are:
Application examples: The default monitoring and report output interval of dstat is 3 seconds, and 10 results are output in the report. Check who is occupying all the memory: Displays some data about CPU resource consumption: # dstat -c -y -l --proc-count --top-cpu How to 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. Summarize The above is a detailed example of the Linux universal system monitoring tool dstat introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website! You may also be interested in:
|
<<: MySQL data backup and restore sample code
>>: Vue implements DingTalk's attendance calendar
In writing styles, we can often see this situatio...
This article shares the specific code of JavaScri...
After clicking the a tag in the page, you want to ...
Table of contents 1. Problem Background 2. What a...
1. Search mysql in the browser to download and in...
【question】 The INSERT statement is one of the mos...
(?i) means do not match case. Replace all uppercas...
The general way of writing is as follows: XML/HTM...
CentOS7 is used here, and the kernel version is [...
This article introduces the import and export of ...
Table of contents 1. Table self-sorting 2. Paging...
To understand what this means, we must first know ...
Effect picture: 1. Import files <script src=&q...
This article example shares the specific code of ...
1. What problems did we encounter? In standard SQ...