network stats

I would like to monitor how much of my Gb network connection I am using.Other than netstat is there any other ways of monitoring my network connection?Also I am having problems with the netstat command itself.If I:

ifconfig -a it tells me that I have a lo0 and a bgeo interface that is up and running.I

If I then run "netstat -i -I bgeo 5" all the values it returns is 0 as if there is no network traffic.Am I doing something wrong?If I run the same command on a solaris 5.1 machine it behaves like I would expect it to.

[539 byte] By [jdavis1] at [2007-11-26 8:33:44]
# 1

Netstat only produces information on packets. You don't know the size of the packet so you cant get the actual network throughput.

Solaris 10 comes with an SNMP agent that you could use for collecting octects on your interface. Then do a delta on the numbers and divide by 8 and that will tell you the traffic. You could use MRTG for that.

Also, interfaces usually end in a number not a letter. You might have to use:

netstat -i -I bge0 5.

Stephen

stephen2602 at 2007-7-6 21:59:51 > top of Java-index,Solaris Operating System,Solaris 10 Features...
# 2

> ifconfig -a it tells me that I have a lo0 and a bgeo

> interface that is up and running.I

>

> If I then run "netstat -i -I bgeo 5" all the values

> it returns is 0 as if there is no network traffic.

> Am I doing something wrong?If I run the same

> command on a solaris 5.1 machine it behaves like I

> would expect it to.

Just because an interface is up doesn't mean that it is used. The routing table would determine that. Perhaps you could show the output of 'netstat -nr'?

--

Darren

Darren_Dunham at 2007-7-6 21:59:51 > top of Java-index,Solaris Operating System,Solaris 10 Features...
# 3

> Netstat only produces information on packets. You

> don't know the size of the packet so you cant get the

> actual network throughput.

Except in his case: 0 packets equals 0 bytes.

> Solaris 10 comes with an SNMP agent that you could

> use for collecting octects on your interface. Then

> do a delta on the numbers and divide by 8 and that

> will tell you the traffic. You could use MRTG for

> that.

Or 'kstat'. That can give you octets in and out.

> Also, interfaces usually end in a number not a letter.

Good point. 'netstat' doesn't give you any warning that you've given an invalid interface...

# netstat -i -I badif 5

inputbadifoutputinput (Total)output

packets errs packets errs colls packets errs packets errs colls

000001049577 01483500

0000030300

0000030100

--

Darren

Darren_Dunham at 2007-7-6 21:59:51 > top of Java-index,Solaris Operating System,Solaris 10 Features...
# 4

I know that I have network traffic as I have a recursive find running on one of the NFS filesystems and I am also running a build of one our products we develope running also.It is using a NFS filesysem also.

Can you give me a small hint on what I am looking for using kstat, "kstat -l" only listed 17K+ entries?

Here is some additional information:

eucm@io: ifconfig -a

lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1

inet 127.0.0.1 netmask ff000000

bge0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2

inet 10.11.100.202 netmask ffffff00 broadcast 10.11.100.255

eucm@io: netstat -nr

Routing Table: IPv4

DestinationGatewayFlags RefUseInterface

-- -- -- --

10.11.100.0 10.11.100.202U 11825 bge0

224.0.0.010.11.100.202U 10 bge0

default 10.11.100.1 UG1497

127.0.0.1127.0.0.1UH489 lo0

eucm@io: netstat -i -I bge0 5

inputbge0outputinput (Total)output

packets errs packets errs colls packets errs packets errs colls

00000285028500

0000000000

0000000000

0000000000

0000000000

0000000000

0000000000

0000000000

jdavis1 at 2007-7-6 21:59:51 > top of Java-index,Solaris Operating System,Solaris 10 Features...
# 5

> I know that I have network traffic as I have a

> recursive find running on one of the NFS filesystems

> and I am also running a build of one our products we

> develope running also.It is using a NFS filesysem

> also.

I'm sure you do. However if you have more than one interface, perhaps it's using that instead?

> Can you give me a small hint on what I am looking for

> using kstat, "kstat -l" only listed 17K+ entries?

One of my scripts does a 'kstat -c net'. Then you'll have the interface at the top of a section like this:

# kstat -c net

module: hmeinstance: 0

name:hme0class:net

align_errors0

[...]

So this is 'hme0'. Now you want the obytes and rbytes (or their 64-bit counterparts). Run the command twice and watch the numbers change.

Something like this might give you most of what you need:

# kstat -c net | egrep '^name|bytes'

--

Darren

Darren_Dunham at 2007-7-6 21:59:51 > top of Java-index,Solaris Operating System,Solaris 10 Features...