Friday September 04, 2009
nicstat - the Solaris and Linux Network Monitoring Tool You Did Not Know You Needed
Just a little one - nicstat now works on shared-ip Solaris zones.
OK, this is heading toward overkill...
The more I publish updates, the more I get requests for enhancement of nicstat. I have also decided to complete a few things that needed doing.
The improvements for this month are:
All source and binaries will from now on be distributed in a tarball. This blog entry will remain the home of nicstat for the time being.
Lastly, I have heard the requests for easier availability in OpenSolaris. Stay tuned.
That's more like it - we should get plenty of coverage now :)
A colleague pointed out to me that nicstat's method of calculating utilization for a full-duplex interface is not correct.
Now nicstat will look for the kstat "link_duplex" value, and if it is 2 (which means full-duplex), it will use the greater of rbytes or wbytes to calculate utilization.
No change to the Linux version. Use the links in my previous post for downloading.
I should probably do this at least once a year, as nicstat needs more publicity...
A number of people have commented to me that nicstat always reports "0.00" for %Util on Linux. The reason for this is that there is no simple way an unprivileged user can get the speed of an interface in Linux (quite happy for someone to prove me wrong on that however).
Recently I got an offer of a patch from David Stone, to add an option to nicstat that tells it what the speed of an interface is. Pretty reasonable idea, so I have added it to the Linux version. You will see this new "-S" option explained if you use nicstat's "-h" (help) option.
I have made another change which makes nicstat more portable, hence easier to build on Linux.
A few years ago, a bloke I know by the name of Brendan Gregg wrote a Solaris kstat-based utility called nicstat. In 2006 I decided I needed to use this utility to capture network statistics in testing I do. Then I got a request from a colleague in PAE to do something about nicstat not being aware of "e1000g" interfaces.
I have spent a bit of time adding to nicstat since then, so I thought I would make the improved version available.
nicstat is to network interfaces as "iostat" is to disks, or "prstat" is to processes. It is designed as a much better version of "netstat -i". Its differences include:
eac-t2000-3[bash]# nicstat 5
Time Int rKB/s wKB/s rPk/s wPk/s rAvs wAvs %Util Sat
17:05:17 lo0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
17:05:17 e1000g0 0.61 4.07 4.95 6.63 126.2 628.0 0.04 0.00
17:05:17 e1000g1 225.7 176.2 905.0 922.5 255.4 195.6 0.33 0.00
Time Int rKB/s wKB/s rPk/s wPk/s rAvs wAvs %Util Sat
17:05:22 lo0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
17:05:22 e1000g0 0.06 0.15 1.00 0.80 64.00 186.0 0.00 0.00
17:05:22 e1000g1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
eac-t2000-3[bash]# nicstat -i e1000g0 5 4
Time Int rKB/s wKB/s rPk/s wPk/s rAvs wAvs %Util Sat
17:08:49 e1000g0 0.61 4.07 4.95 6.63 126.2 628.0 0.04 0.00
17:08:54 e1000g0 0.06 0.04 1.00 0.20 64.00 186.0 0.00 0.00
17:08:59 e1000g0 239.2 2.33 174.4 33.60 1404.4 71.11 1.98 0.00
17:09:04 e1000g0 0.01 0.04 0.20 0.20 64.00 186.0 0.00 0.00
|
For more examples, see the man page.
Note - the Solaris binaries will work on later releases; and probably on earlier releases of Solaris - as Solaris is just like that...
Posted at 02:35PM Sep 04, 2009 by timc in Performance | Comments[5]
"Lastly, I have heard the requests for easier availability in OpenSolaris. Stay tuned." - cool, I was thinking about submitting it via SourceJuicer myself but I will leave it to you then! :)
Posted by Robert Milkowski on September 16, 2009 at 05:16 AM PDT #
tim -
loving the nicstat possibilities, but it won't compile/install in a default Opensolaris 2009-06 (b 111b) image. Man I miss SXCE already.
Here's what else you need:
# pkg install SUNWhea
# pkg install ss-dev
(warning: ss-dev is a 285MB download)
ref:
http://mail.opensolaris.org/pipermail/opensolaris-help/2008-July/007359.html
And your readme rev 1.21 has the same 2 lines for the Solaris and Linux install syntax (typo). I think you should have a separate line for SPARC installs, because some of us use and love SPARC too.
Posted by svrocket on October 20, 2009 at 01:08 AM PDT #
This is now packaged at www.opencsw.org so it's easy to install with pkgutil for Solaris 8+ i386 and Sparc.
Posted by Peter Bonivart on October 29, 2009 at 03:28 AM PDT #
Is there a way to get Zone specific network performance measurements? We'd like to use this info to help us in sizing virtualized environments. read/write network packet/bytes per second usage for each zone.
Posted by andrew garcia on January 18, 2010 at 12:20 PM PST #
Hi.
First of all thanks for the tool it's very nice.
Could be possible in the new version to add a flag that show the version of the binary.
Something like:
# nicstat -v
1.21
JLBG
Posted by Jose Luis Barquín Guerola on January 27, 2010 at 07:08 AM PST #