Friday September 24, 2004 Solaris 10 and MIB counters Solaris 10 provides a couple of new ways to look at various networking-related MIB2 counters.
One is via kstat(1M) command. Try the following on Solaris 10 system:
$ kstat -c mib2
module: icmp instance: 0
name: rawip class: mib2
crtime 58.54669218
inCksumErrs 0
inDatagrams 204641
inErrors 0
outDatagrams 19
outErrors 0
snaptime 274094.194688545
...
module: sctp instance: 0
name: sctp class: mib2
crtime 58.446876953
sctpAborted 0
sctpActiveEstab 0
sctpChecksumError 0
sctpCurrEstab 0
...
module: udp instance: 0
name: udp class: mib2
crtime 58.522156463
entry6Size 48
entrySize 20
inDatagrams 546726
inErrors 0
outDatagrams 470496
outErrors 0
snaptime 274094.224208608
(Note the new SCTP counters useful if you use the new SCTP protocol).
You can get just IP counters by asking
$ kstat -m ip -c mib2
Or you can watch as they grow over time:
$ kstat -p 'ip::icmp:inMsgs' 1
ip:0:icmp:inMsgs 155322
ip:0:icmp:inMsgs 155322
ip:0:icmp:inMsgs 155322
ip:0:icmp:inMsgs 155324
ip:0:icmp:inMsgs 155326
...
This mechanism is more efficient than
netstat -s command.
Due to the way netstat is working, running netstat too often may actually hurt your system performance.
Now if you are really interested why some of these counters are incremented, DTrace
mib provider may be quite useful.
For example, what processes write to the network?
$ dtrace -n 'mib:ip::tcpOutSegs{@[execname]=count()}'
dtrace: description 'mib:ip::tcpOutSegs' matched 1 probe
^C
nfs4cbd 1
firefox-bin 1
ftp 4
sched 6
( Sep 24 2004, 07:59:08 PM PDT ) Permalink Comments [1]