nicstat(1)
β¨ nicstat(1) β¨
okay bestie, sit down, hydrate, because we're about to talk about nicstat β it's a general commands manual page, and it's literally the moment your NICs finally tell you what they've been up to. π«Ά
It ships with a twin called enicstat too. They're a package deal. π
πΈ NAME πΈ
nicstat, enicstat β print network traffic statistics π
π SYNOPSIS π
nicstat [-hvnsxpztualkMU] [-iinterface] [-Sint:mbps[fd|hd]] [interval [count]]
enicstat <same options & operands>
π¦ DESCRIPTION π¦
So here's the vibe: nicstat prints out network statistics for all your network cards (NICs). Packets? yes. Kilobytes per second? yes. Average packet sizes? yes. And more, because it simply cannot stop serving. π
β¨ OPTIONS β¨
-hβ shows you a quick lil usage message. The help. The "what do I even type" moment. π-vβ shows thenicstatversion. And when you pair it with-l, you get extra fields too. combo meal. π-nβ only shows stats for non-local interfaces, aka the non-loopback ones. bye bye loopback.-sβ summary output mode. Just the amount of data received (read) and transmitted (written). short and sweet.-xβ extended output. peek the OUTPUT section for the deets. π-Uβ shows read and write utilization statistics separately. This one affects the default format, the extended (-x) format, and the all (-a) format. Heads up: in the default format, theSatstatistic gets dropped so everything still fits in 80 columns. sacrifice made, aesthetic preserved. π-Mβ shows interface throughput in Mbps (megabits per second) instead of the default KB/s (kilobytes per second).
NOTE β interface statistics get reported to operating systems in bytes. nicstat genuinely does not know whether Ethernet or other hardware overheads are included in that statistic on each platform. so like, it's not being shady, it just doesn't know. π
-pβ parseable output format. One line per interface, in these formats (matching the default,-x,-tand-uoptions respectively):
time:In:rKB/s:wKB/s:rPk/s:wPk/s:%Util:Sat
time:In:rKB/s:wKB/s:rPk/s:wPk/s:%Util:Sat:IErr:OErr:Coll:NoCP:Defer
time:TCP:InKB:OutKB:InSeg:OutSeg:Reset:AttF:%ReTX:InConn:OutCon:Drops
time:UDP:InDG:OutDG:InErr:OutErr
where time is the number of seconds since midnight, Jan 1 1970 (UST), and the other fields are exactly as described in the OUTPUT section below.
NOTE β for parseable formats, throughput statistics are always in KB/s (kilobytes per second), even if you passed the -M flag. the flag does not win here. sorry bestie.
-zβ skips interfaces that had zero traffic during the sample period. if you did nothing, you get nothing. π€·-tβ shows TCP statistics.-uβ shows UDP statistics.-aβ equivalent to-x -t -u. the everything bagel. π₯―-lβ just lists the interfaces. that's it. that's the whole job.-iinterface[,interface...] β shows stats for only the interface(s) you list. You can list multiple, separated by commas (,).-Sint:speed[fd|hd] β (Linux only π) specify the speed β and optionally the duplex mode β of one or more interfaces. The speed(s) you give are in megabits/second. Duplex mode defaults to "full" unless you tack on a suffix starting withhorH. On Solaris, speed and duplex mode get obtained automatically from theifspeedandlink_duplexkstat values. no manual labour required. π-kβ (Solaris only π) searches for active network interfaces by looking for kstatlink_statestatistics with a value of1. This is only useful on systems running Solaris 10 (or early releases of Solaris 11 Express) with Exclusive IP Zones, where the interfaces handed to an Exclusive IP Zone are not otherwise visible. If you're on Solaris 9 (or earlier), or Solaris 11 (or later), you do not need this option. skip it, it's not for you.
π OPERANDS π
- interval β the number of seconds between samples.
- count β how many times the statistics get repeated. If you don't specify a count,
nicstatwill repeat statistics indefinitely. forever. periodt. βΎοΈ
π OUTPUT π
The fields of nicstat's display are:
- Time β the time corresponding to the end of the sample shown, in
HH:MM:SSformat (24-hour clock). - Int β the interface name.
rKB/s,InKBβ kilobytes/second read (received).wKB/s,OutKBβ kilobytes/second written (transmitted).rMbps,RdMbpsβ megabits/second read (received).wMbps,WrMbpsβ megabits/second written (transmitted).rPk/s,InSeg,InDGβ packets (TCP segments, UDP datagrams)/second read (received).wPk/s,OutSeg,OutDGβ packets (TCP segments, UDP datagrams)/second written (transmitted).rAvsβ average size of packets read (received).wAvsβ average size of packets written (transmitted).%Utilβ percentage utilization of the interface. For full-duplex interfaces, this is the greater ofrKB/sorwKB/sas a percentage of the interface speed. For half-duplex interfaces,rKB/sandwKB/sget summed. math! π₯%rUtil,%wUtilβ percentage utilization for bytes read and written, respectively.Satβ saturation. This is the number of errors/second seen for the interface β an indicator the interface may be approaching saturation. This statistic is combined from a number of kernel statistics. It's recommended to use the-xoption to see more individual statistics (the ones mentioned below) when you're trying to diagnose a network issue.IErrβ packets received that could not be processed because they contained errors.OErrβ packets that were not successfully transmitted because of errors.Collβ Ethernet collisions during transmit.NoCPβ No-can-puts. This is when an incoming packet can not be put to the process reading the socket. This suggests the local process is unable to process incoming packets in a timely manner. πDeferβ Defer Transmits. Packets without collisions where the first transmit attempt was delayed because the medium was busy.ResetβtcpEstabResets. The number of times TCP connections have made a direct transition to theCLOSEDstate from either theESTABLISHEDstate or theCLOSE-WAITstate.AttFβtcpAttemptFailsβ the number of times that TCP connections have made a direct transition to theCLOSEDstate from either theSYN-SENTstate or theSYN-RCVDstate, plus the number of times TCP connections have made a direct transition to theLISTENstate from theSYN-RCVDstate.%ReTXβ percentage of TCP segments retransmitted β that is, the number of TCP segments transmitted containing one or more previously transmitted octets.InConnβtcpPassiveOpensβ the number of times that TCP connections have made a direct transition to theSYN-RCVDstate from theLISTENstate.OutConβtcpActiveOpensβ the number of times that TCP connections have made a direct transition to theSYN-SENTstate from theCLOSEDstate.DropsβtcpHalfOpenDrop + tcpListenDrop + tcpListenDropQ0.
tcpListenDrop and tcpListenDropQ0 β number of connections dropped from the completed connection queue and incomplete connection queue, respectively. tcpHalfOpenDrops β number of connections dropped after the initial SYN packet was received.
The first set of statistics printed are averages since system boot. If no interval operand is specified, or a count value of 1 is specified, this will be the only sample printed. one and done. β¨
π EXAMPLES π
Print average statistics from boot time to now only:
$ nicstat
Print statistics for all interfaces, every 3 seconds:
$ nicstat 3
Print statistics for all interfaces, every 5 seconds, finishing after 10 samples:
$ nicstat 5 10
Print statistics every 3 seconds, only for interfaces "hme0" and "hme1":
$ nicstat -i hme0,hme1 3
Print statistics for non-local interfaces, setting speed of "eth0" and "eth1" to 10mbps/half-duplex and 1000mbps/full-duplex, respectively:
$ nicstat -n -S eth0:10h,eth1:1000 5
π SEE ALSO π
netstat(1M) kstat(1M), kstat(3KSTAT), mibiisa(1M), ethtool(8)
"nicstat - the Solaris and Linux Network Monitoring Tool You Did Not Know You Needed" -http://blogs.oracle.com/timc/entry/nicstat_the_solaris_and_linux
π§ NOTES π§
On Linux, the NoCP, Defer, TCP InKB, and TCP OutKB statistics are always reported as zero. don't come for them, they're just built different.
The way that saturation is reported is a best effort, because there's no standardized naming to capture all errors related to an interface's inability to receive or transmit a packet. Monitoring %Util and packet rates, plus actually understanding the specific NICs, may be more useful in judging whether you're nearing saturation. ngl, vibes + context > one number. π«Ά
The -S option is provided for the Linux edition because nicstat requires super-user privilege to obtain speed and duplex mode information for interfaces. If you can't set up nicstat as setuid-root, there's a script named enicstat available β it uses the ethtool utility and then calls nicstat with an -S value. ethtool itself requires super-user privilege for this to work, so like, root or nothing, bestie. π
and that's the whole page!! from the 4th Berkeley Distribution, dated 27 Jan 2014, and yeah the manual section is nicstat(1). go watch your NICs thrive. you're welcome. π
πβ¨
π¦ where this page comes from
- debian bookworm: nicstat 1.95-1+b2 Β· Artistic-1.0-Perl
- debian trixie: nicstat 1.95+git20150820.3c2407d-1 Β· Artistic-1.0-Perl
- ubuntu jammy: nicstat 1.95-1build3 Β· Artistic-1.0-Perl
- ubuntu noble: nicstat 1.95-1build3 Β· Artistic-1.0-Perl
- ubuntu questing: nicstat 1.95+git20150820.3c2407d-1
- ubuntu resolute: nicstat 1.95+git20150820.3c2407d-1build1 Β· Artistic-1.0-Perl
- ubuntu stonking: nicstat 1.95+git20150820.3c2407d-1build1 Β· Artistic-1.0-Perl
- Copyright (c) 2009-2014, Tim Cook, Oracle Corporation
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms