Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How Linux installs and uses dstat monitoring tools

2025-01-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "how Linux installs and uses dstat monitoring tools". The content of the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how Linux installs and uses dstat monitoring tools".

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 of statistics

When analyzing and troubleshooting, you can enable monitoring items and sort

Modular design

Written in python to make it easier to extend existing tasks

It is easy to expand and add your counters (please contribute to this)

Many of the included extensions fully illustrate the convenience of adding new monitoring projects

Block devices / network devices can be grouped and the total number is given.

You can display the current status of each device

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

Display accurate units and limit the range of conversion errors

Display different units in different colors

Display the intermediate result with a delay of less than 1 second

Support for exporting reports in CSV format, and can be imported into Gnumeric and Excel to generate graphics

Installation method

Ubuntu/Mint and Debin systems:

There are related installation packages in the local software library. You can install them with the following command:

# sudo apt-get install dstat

RHEL/CentOS and Fedora systems:

You can add relevant installation packages to the romforge software library. Refer to the instructions and use the following command to install them easily:

# yum install dstat

ArchLinux system:

The related software package is in the community repository, and you can install it with this command:

# pacman-S dstat

Method of use

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:

CPU status: usage of CPU. The more interesting part of the report is that it shows the users, systems, and free parts, which gives a better analysis of the current usage of CPU. If you see that the status of CPU in the "wait" column is a high usage value, there are some other problems with the system. When the state of CPU is in "waits", it is because it is waiting for a response from an Imax O device (such as memory, disk, or network) and has not yet received it.

Disk statistics: the read and write operations of the disk. This column shows the total number of reads and writes to the disk.

Network statistics: data sent and received by network equipment. This column shows the total number of data received and sent by the network.

Paging statistics: the paging activity of the system. Paging refers to a memory management technique used to find system scenarios. A large page indicates that the system is using a lot of swap space, or memory is very scattered, and in most cases you want to see that the values of page in and page out are 0.

System statistics: this item shows int and context switching (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 refreshes data every second. If you want to quit 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 numerical values.

This is because dstat gives a summary from the previous report, so the first run does not have data about averages and total values.

However, dstat can control the report interval and the number of reports by passing two parameters to run. For example, if you want dstat to output default monitoring, report output interval of 3 seconds, and output 10 results in the report, you can run the following command:

Dstat 310

There are many parameters to choose from in the dstat command, which you can see through the man dstat command. Most commonly used parameters are these:

-l: display load statistics

-m: displays memory usage (including used,buffer,cache, free values)

-r: displays Istroke O statistics

-s: displays the usage of the swap partition

-t: displays the current time on the first line

-fs: displays file system statistics (including total number of files and inodes values)

-nocolor: do not display colors (sometimes useful)

-socket: displays network statistics

-tcp: displays commonly used TCP statistics

-udp: some dynamic data showing the listening 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: displays the busy status of the disk at a certain time

-- freespace: displays the current disk space utilization

-- proc-count: displays the number of programs running

-- top-bio: indicates the largest process of block iBand O

-- top-cpu: graphically shows the processes that CPU takes up the most

-- top-io: displays the maximum process of normal Iamp O

-- top-mem: displays the processes that consume the most memory

To give some examples:

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-- top-cpu

How to output a csv file

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

# dstat-output / tmp/sampleoutput.csv-cdn

Thank you for reading, the above is the content of "how Linux installs and uses dstat monitoring tools". After the study of this article, I believe you have a deeper understanding of how Linux installs and uses dstat monitoring tools, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report