Network Traffic Statistics utility nicstat
- Nicstat Installation
Nicstat installation:
# Wget-c http://nchc.dl.sourceforge.net/project/nicstat/nicstat-1.92.tar.gz# tar zxvf nicstat-1.92.tar.gz # cd nicstat-1.92 # cp Makefile. linux Makefile # uname-mx86_64 # diff Makefile. linux # if it is not a 64-bit machine, you do not need to modify Makefile17c17 <CFLAGS =$ (COPT) ---> CFLAGS =$ (COPT) -m3225c25 <CPUTYPE = x86_64 ---> CPUTYPE = i386 # make & make install
- Use nicstat
There is a nicstat. sh script in the extract package directory nicstat-1.92.
- View Nic speed (-l ):
[root@CentOS192 nicstat-1.92]# ./nicstat.sh -lInt Loopback Mbit/s Duplex Statelo Yes - unkn upeth0 No 1000 full up
- Check the result twice at an interval of 3 seconds (note % Util AND Sat ):
[root@centos192 nicstat-1.92]# ./nicstat 3 2 Time Int rKB/s wKB/s rPk/s wPk/s rAvs wAvs %Util Sat06:19:46 lo 0.72 0.72 2.15 2.15 341.2 341.2 0.00 0.0006:19:46 eth0 0.89 0.15 1.37 0.92 660.4 163.6 0.00 0.00 Time Int rKB/s wKB/s rPk/s wPk/s rAvs wAvs %Util Sat06:19:49 lo 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.0006:19:49 eth0 0.02 0.12 0.33 0.33 66.00 354.0 0.00 0.00
Time column: the response Time of the current sample.
Lo and eth0: Nic name.
RKB/s: Number of kilobytes received per second.
WKB/s: Number of kilobytes written per second.
RPk/s: the number of packets received per second.
WPk/s: number of data packets written per second.
RAvs: Average size of received data packets.
WAvs: Average size of transmitted data packets.
% Util: Nic utilization (percentage ).
Sat: number of errors per second on the network card. Whether the network card is close to a full indicator. We recommend you use the-x option to view more statistics when trying to diagnose network problems.
- View extension information (-x and-s ):
[root@centos192 nicstat-1.92]# ./nicstat 3 2 -x06:33:57 RdKB WrKB RdPkt WrPkt IErr OErr Coll NoCP Defer %Utillo 0.69 0.69 2.08 2.08 0.00 0.00 0.00 0.00 0.00 0.00eth0 0.86 0.14 1.33 0.89 0.00 0.00 0.00 0.00 0.00 0.0006:34:00 RdKB WrKB RdPkt WrPkt IErr OErr Coll NoCP Defer %Utillo 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00eth0 0.02 0.12 0.33 0.33 0.00 0.00 0.00 0.00 0.00 0.00
[root@centos192 nicstat-1.92]# ./nicstat.sh -s Time Int rKB/s wKB/s06:37:48 lo 0.685 0.68506:37:48 eth0 0.848 0.140
- View tcp information (-t ):
[root@centos192 nicstat-1.92]# ./nicstat.sh -t05:15:05 InKB OutKB InSeg OutSeg Reset AttF %ReTX InConn OutCon DropsTCP 0.00 0.00 4.01 3.50 0.00 0.01 0.000 0.05 0.09 0.0
InKB: the number of kilobytes received per second.
OutKB: The kilobytes transmitted per second.
InSeg: the TCP data segment received per second (TCP Segments ).
OutSeg: Specifies the TCP segment (TCP Segments) transmitted per second ).
Reset: the number of times the TCP connection has been directly changed from ESTABLISHED or CLOSE-WAIT to CLOSED.
AttF: indicates the number of times a TCP connection has changed directly from a SYN-SENT or SYN-RCVD to a CLOSED state, plus the number of times a TCP connection has changed directly from a SYN-RCVD state to a LISTEN state
% ReTX: indicates the percentage of TCP segment (TCP Segments) retransmission. That is, the transmitted TCP segment contains one or more eight bytes previously transmitted.
InConn: the number of times the TCP connection has changed from the LISTEN state to the SYN-RCVD state.
OutCon: the number of times the TCP connection has changed from the CLOSED state to the SYN-SENT state.
Drops: indicates the number of dropped connections from the queue of the completed connection and the queue of the incomplete connection.
- View udp information (-u ):
[root@centos192 nicstat-1.92]# ./nicstat.sh -u06:39:42 InDG OutDG InErr OutErrUDP 0.01 0.01 0.00 0.00
InDG: UDP datagram rams received per second)
OutDG: UDP datagram rams transmitted per second)
InErr: received packets that cannot be processed due to inclusion errors
OutErr: data packets that cannot be transmitted due to errors.
- By default, the unit is KB. Now, the unit is MB:
[root@centos192 nicstat-1.92]# ./nicstat.sh -M Time Int rMbps wMbps rPk/s wPk/s rAvs wAvs %Util Sat05:16:55 lo 0.01 0.01 2.55 2.55 341.2 341.2 0.00 0.0005:16:55 eth0 0.01 0.00 1.61 1.08 667.3 163.7 0.00 0.00
- Other usage:
[root@centos192 nicstat-1.92]# ./nicstat.sh -x -t -u06:49:25 InKB OutKB InSeg OutSeg Reset AttF %ReTX InConn OutCon DropsTCP 0.00 0.00 3.16 2.74 0.00 0.01 0.000 0.04 0.07 0.0006:49:25 InDG OutDG InErr OutErrUDP 0.01 0.01 0.00 0.0006:49:25 RdKB WrKB RdPkt WrPkt IErr OErr Coll NoCP Defer %Utillo 0.67 0.67 2.00 2.00 0.00 0.00 0.00 0.00 0.00 0.00eth0 0.83 0.14 1.29 0.86 0.00 0.00 0.00 0.00 0.00 0.00
[root@centos192 nicstat-1.92]# ./nicstat.sh -a06:50:43 InKB OutKB InSeg OutSeg Reset AttF %ReTX InConn OutCon DropsTCP 0.00 0.00 3.15 2.74 0.00 0.01 0.000 0.04 0.07 0.0006:50:43 InDG OutDG InErr OutErrUDP 0.01 0.01 0.00 0.0006:50:43 RdKB WrKB RdPkt WrPkt IErr OErr Coll NoCP Defer %Utillo 0.66 0.66 1.99 1.99 0.00 0.00 0.00 0.00 0.00 0.00eth0 0.82 0.14 1.28 0.86 0.00 0.00 0.00 0.00 0.00 0.00
"-A" is equivalent to "-x-t-u.