In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >
Share
Shulou(Shulou.com)06/01 Report--
View the real-time Nic traffic of the Linux server:
1. Sar-n DEV 1 2
The sar command is included in the sysstat toolkit and provides a wide range of statistics for the system. There are some differences in commands on different systems. The sar provided by some systems supports data statistics based on the network interface, and you can also view the number and traffic of sending and receiving packets per second on the device.
Sar-n DEV 1 2
The last 1 / 2 of the command means: take the value once every second and take it twice.
DEV displays network interface information
In addition, the-n parameter is very useful, it has six different switches: DEV | EDEV | NFS | NFSD | SOCK | ALL, which means:
DEV displays network interface information.
EDEV displays statistics about network errors.
NFS counts the information of the active NFS client.
NFSD statistics information of NFS server
SOCK displays socket information
ALL shows all 5 switches
[sre@CDVM-213017031] $sar-n DEV 1 2Linux 2.6.32-431.el6.x86_64 (CDVM-213017031) 05 04PM IFACE rxpck/s txpck/s rxkB/s txkB/s rxcmp/s txcmp/s rxmcst/s08:05:31 PM lo 2017 _ x86q644 CPU 08:05:30 PM IFACE rxpck/s txpck/s rxkB/s txkB/s rxcmp/s txcmp/s rxmcst/s08:05:31 PM lo 0.00 0.00 0.00 0.0008 DEV 05DEV 31 PM eth0 1788.00 1923.00 930.47 335. 60 0.00 0.00 0.0008:05:31 PM IFACE rxpck/s txpck/s rxkB/s txkB/s rxcmp/s txcmp/s rxmcst/s08:05:32 PM lo 0.00 0.00 0.00 0.0008:05:32 PM eth0 1387.00 1469.00 652.12 256.98 0.00 0.00 0.00Average: IFACE rxpck/s txpck/s rxkB/s txkB/s rxcmp/s txcmp/s rxmcst/sAverage: lo 0.000 . 00 0.00 0.00 0.00 0.00Average: eth0 1587.50 1696.00 791.29 296.29 0.00 0.00 0.00
Parameter description:
IFACE:LAN interface
Rxpck/s: packets received per second
Txpck/s: packets sent per second
Rxbyt/s: bytes received per second
Txbyt/s: bytes sent per second
Rxcmp/s: compressed packets received per second
Txcmp/s: compressed packets sent per second
Rxmcst/s: multicast packets received per second
Rxerr/s: bad packets received per second
Txerr/s: bad packets sent per second
Coll/s: collisions per second
Rxdrop/s: the number of received packets discarded per second because the buffer is full
Txdrop/s: the number of sent packets discarded per second because the buffer is full
Txcarr/s: carrier errors per second when sending packets
Rxfram/s: the number of frame alignment errors received per second
Rxfifo/s: number of FIFO overspeed errors per second of packets received
Txfifo/s: the number of FIFO overspeed errors per second of packets sent
2 、 cat / proc/net/dev
The Linux kernel provides a mechanism to access kernel internal data structures and change kernel settings at run time through the / proc file system. The proc file system is a pseudo file system that only exists in memory and does not take up out-of-memory space. It provides an interface to access the kernel data of the system in the way of file system. Users and applications can get information about the system through proc and can change some parameters of the kernel. Because the information of the system, such as the process, changes dynamically, when the user or application reads the proc file, the proc file system dynamically reads the required information from the system kernel and submits it. The / proc file system contains a number of directories, of which / proc/net/dev holds network adapters and statistics.
[sre@CDVM-213017031 ~] $cat / proc/net/dev Inter- | Receive | Transmit face | bytes packets errs drop fifo frame compressed multicast | bytes packets errs drop fifo colls carrier compressed lo:137052296 108029 000000 137052296 108029000000 eth0:13661574714188 3134679062000005097461049535 27671144304 000000000 the leftmost name is the name of the interface, Receive represents the receiving packet, Transmit represents the sending packet; bytes represents the number of bytes sent and received; packets represents the correct number of packets sent and received; errs represents the number of packets sent and received incorrectly Drop indicates the number of discarded packets sent and received.
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.