Article: 82066 of comp.unix.solaris
Newsgroups: comp.unix.solaris
Date: Sun, 25 Jul 2004 18:33:24 +1000
From: Brendan Gregg <brendan.gregg@tpg.com.au>
X-X-Sender:  <brendan@mars.drinks.com>
Subject: nicstat - network Kbytes/sec statistics
Message-ID: <Pine.GSO.4.33.0407251831050.287-100000@mars.drinks.com>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
NNTP-Posting-Host: 220.244.170.58
X-Original-NNTP-Posting-Host: 220.244.170.58
X-Trace: dnews.tpgi.com.au!tpg.com.au 1090744741 220.244.170.58 (25 Jul 2004 18:39:01 +1000)
Lines: 54
Path: news.meer.net!newsread1.mlpsca01.us.to.verio.net!newsartnum1.dllstx09.us.to.verio.net!newspeer1.stngva01.us.to.verio.net!news.verio.net!newsfeed.vmunix.org!news2.euro.net!fi.sn.net!newsfeed2.fi.sn.net!feeder2.news.jippii.net!feeder1.news.jippii.net!news.net.hanse.com!nntp.gblx.net!nntp3.phx1!dnews.tpgi.com.au!tpg.com.au!tpgext!brendan
Xref: archive.mv.meer.net comp.unix.solaris:82066

G'Day,

I've just written a handy freeware tool to print network interface
statistics - Kbytes/sec read and written. eg,

   $ nicstat 1
       Time   Int   rKb/s   wKb/s   rPk/s   wPk/s    rAvs    wAvs   %Util
   00:45:29  hme0    2.27    9.02   11.37   16.52  204.23  559.15    0.09
   00:45:30  hme0    0.37    0.67    6.02    9.03   62.67   75.78    0.01
   00:45:31  hme0    0.31    0.67    5.01    9.01   63.20   75.78    0.01
   00:45:32  hme0    0.31    0.67    5.00    9.00   63.20   75.78    0.01
   00:45:33  hme0    0.31    0.67    5.00    9.00   63.20   75.78    0.01
   00:45:34  hme0    1.52    2.18   16.00   19.00   97.37  117.37    0.03
   00:45:35  hme0    0.31    0.61    5.00    8.00   63.20   78.50    0.01
   00:45:36  hme0    8.67 1280.35  129.98  929.84   68.31 1410.01   10.56
   00:45:37  hme0   17.89 2933.96  277.79 2113.40   65.95 1421.58   24.18
   00:45:38  hme0   18.09 2954.55  281.16 2128.19   65.89 1421.61   24.35
   00:45:39  hme0   10.15 1585.97  157.05 1149.37   66.15 1412.97   13.08
   00:45:40  hme0    0.31    0.67    5.00    9.00   63.20   75.78    0.01
   00:45:41  hme0    0.42    0.67    6.00    9.00   72.33   75.78    0.01
   00:45:42  hme0    0.31    0.67    5.00    9.00   63.20   75.78    0.01
   [...]

The SE Toolkit's "nx.se" does this already (and does it better), I wrote
"nicstat" as a simple Perl Kstat program for when you want a quick look.

It's at, http://www.brendangregg.com/k9toolkit.html


... and it does something meaningful with multiple network cards,

   $ nicstat 5
       Time   Int   rKb/s   wKb/s   rPk/s   wPk/s    rAvs    wAvs   %Util
   00:58:02  hme0    0.12    0.01    1.05    0.04  113.53  238.16    0.00
   00:58:02  qfe0    2.94    0.53    5.97    3.70  504.29  147.69    0.03
   00:58:02  qfe1    6.79   26.37   17.71   25.47  392.55 1060.22    0.27
   00:58:02  qfe2    0.27    7.78    3.24    6.10   86.74 1306.18    0.07
   00:58:02  qfe3    1.15   20.30    8.09   15.78  145.72 1317.10    0.18
   00:58:07  hme0    0.00    0.00    0.00    0.00    0.00    0.00    0.00
   00:58:07  qfe0    0.04    0.25    0.60    0.80   60.00  316.25    0.00
   00:58:07  qfe1    0.00    0.00    0.00    0.00    0.00    0.00    0.00
   00:58:07  qfe2    0.00    0.00    0.00    0.00    0.00    0.00    0.00
   00:58:07  qfe3    0.14    0.19    0.60    0.60  246.67  319.67    0.00
   [...]

the first lines are the summary since boot data.

Enjoy,

Brendan Gregg

[Sydney, Australia]




