[O & M personnel? Why? 02: 20 built-in monitoring tools for Linux: vmstat and netstat

Source: Internet
Author: User
[O & M personnel? Why? 02] 20 built-in monitoring tools for Linux: vmstat and netstat? Communications Administration? Song? Too many ?? Yellow? Argon? [O & M personnel? Why? 01] 20 built-in monitoring tools for Linux systems: top-level gossip, Reading Zhao Hao (& amp; cap; _ & amp; cap;) O ~... [O & M personnel? Why? 02] 20 built-in monitoring tools for Linux: vmstat and netstat? Communications Administration? Song? Too many ?? Yellow? Argon? [O & M personnel? Why? 01] 20 built-in monitoring tools for Linux systems: top-level gossip-less explanation, and look at Zhao Hao (Taobao _ workshop) O ~ (2) if vmstat is written in front, here Rocky should be a bit cool, privately think that the best practices of vmstat should also be: "Which part of the resource is most frequently used?" Let's take a look at vmstat's output [plain] [root @ Rocky ~] # Vmstat 5 3 procs ----------- memory ---------- --- swap -- ----- io ---- system -- ----- cpu ------ r B swpd free buff cache si so bi bo in cs us sy id wa st 0 0 0 1249892 29292 410624 0 0 143 101 206 2 2 94 2 0 1 0 1249628 29316 410624 0 0 0 60 95 210 2 3 94 1 0 0 1249644 29316 0 0 0 0 0 0 0 0 0 93 189 0 0 100 0 0 ① project [procs] displays the r related to the process: number of processes waiting for running B: The more blocked processes in the two columns, the more busy the system is. ② project [memory] displays memory-related swpd: Used swap capacity (KB) free: Available physical memory (KB) buff: used by the file metadata (KB) cache: size used by the file data (KB) ③ project [swap] displays swap-related si: the size of data read from SWAP to RAM (swap in) (KB/sec) so: size of data written from RAM to SWAP (swap out) (KB/sec) if the si/so ratio is too large, it indicates that the data in the memory is often tumble between the disk and the physical memory, and the system performance is very poor. ④ project [io] shows the bi related to disk read/write: data transmission rate (Block/second) bo: the rate at which data is read from the disk (Block/second) if the value of this part is higher, it indicates that the system I/O is very busy. ⑤ project [system] displays in: the number of interrupted processes per second. cs: the greater the context-changing rate in the process space, the more frequent the communication between the system and the surrounding devices (such as NICs, disks, and time clocks ). [Cpu] displays the CPU load-related us: CPU usage in the user process, and the Oracle Process belongs to this kind of sy: CPU usage in the system process id: available CPU usage wa: percentage of consumed on "Waiting for I/O" st: Percentage of consumed CPU on the VM. Below are some common usage I once per second, total three times: vmstat 1 3 3 (3) netstat: The best practice of netstat is to show your attitude and view the network connection status. let's take a look at netstat output: [plain] [root @ localhost ~] # Netstat-lntp Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 127.0.0.1: 2208 0.0.0.0: * LISTEN 3890 /. /hpiod tcp 0 0.0.0.0: 3306 0.0.0.0: * LISTEN 4055/mysqld tcp 0 0 0.0.0.0: 111 0.0.0.0: * LISTEN 3604/portmap tcp 0 0 192.168.122.1: 53 0.0.0.0: * LISTEN 4379/dnsmasq tcp 0 0 0.0.0.0: 22 0.0.0.0: * LISTEN 3908/sshd tcp 0 0 0.0.0.0: 854 0.0.0.0: * LISTEN 3640/rpc. statd tcp 0 0 127.0.0.1: 631 0.0.0.0: * LISTEN 3021/cupsd tcp 0 0 127.0.0.1: 25 0.0.0.0: * LISTEN 4099/sendmail tcp 0 0 127.0.0.1: 2207 0.0.0.0: * LISTEN 3895/python tcp 0: 5989: * LISTEN 4382/cimservermain tcp 0: 22: * LISTEN 3908/sshd ① Local Address: local IP: PORT ② Foreign Address: remote IP: PORT ③ State: connection status, mainly including [ESTABLISED] [LISTEN] for example: find the network connection that has been monitored on the system and PID [plain] [root @ localhost ~] # Netstat-lntp Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 127.0.0.1: 2208 0.0.0.0: * LISTEN 3890 /. /hpiod tcp 0 0.0.0.0: 3306 0.0.0.0: * LISTEN 4055/mysqld tcp 0 0 0.0.0.0: 111 0.0.0.0: * LISTEN 3604/portmap tcp 0 0 192.168.122.1: 53 0.0.0.0: * LISTEN 4379/dnsmasq tcp 0 0 0.0.0.0: 22 0.0.0.0: * LISTEN 3908/sshd tcp 0 0 0.0.0.0: 854 0.0.0.0: * LISTEN 3640/rpc. statd tcp 0 0 127.0.0.1: 631 0.0.0.0: * LISTEN 3021/cupsd tcp 0 0 127.0.0.1: 25 0.0.0.0: * LISTEN 4099/sendmail tcp 0 0 127.0.0.1: 2207 0.0.0.0: * LISTEN 3895/python tcp 0: 5989: * LISTEN 4382/cimservermain tcp 0: 22 ::: * LISTEN 3908/sshd: disable the network service 192.168.122.1: 53 [plain] [root @ localhost ~] # Kill-9 4379 [root @ localhost ~] # Killall-9 dnsmasq
Related Article

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.