1753971 Members
7943 Online
108811 Solutions
New Discussion юеВ

LAN traffic load in byte

 
SOLVED
Go to solution
Jun H. Lee
Advisor

LAN traffic load in byte

Hi.
I need to measure the server LAN traffic load in byte for daily or weekly. Is there anyway that I can read this traffic statistics from HP-UX? Or, do I need a special software or appliance to measture this?

Please advice.
Thanks.
2 REPLIES 2
VK2COT
Honored Contributor

Re: LAN traffic load in byte

Hello,

You can do it in many ways.

The simplest one is to use:

netstat -in

Here is an example for HP-UX 11.1:

Name Mtu Network Address Ipkts Ierrs Opkts Oerrs Coll
lan0 1500 15.170.178.0 15.170.178.191 11275129 0 12984016 0 0
lo0 32808 127.0.0.0 127.0.0.1 2854459 0 2854459 0 0

It will report traffic in each interface.
You an create a cron job and summarize
reports any way you like.

Or, you can use more comprehensive tools
like OpenView, other SNMP-based solutions,
tcpdump(1), and so on.

Since your requirement is simple, just
use netstat(1).

Cheers,

VK2COT
VK2COT - Dusan Baljevic
Ralph Grothe
Honored Contributor
Solution

Re: LAN traffic load in byte

You don't require any extra software.
You can just use hpux's standard lanadmin command and query the mibstats for the relevant NIC.
E.g. here on this box I took 2 samples from lan0 within 10 secs.
So to get rates one only needs to divide the diffs by the sampling intervals to approximately get the first derivative.
As these are octets you only need to multiply
by 8 and divide by 1000 to get measures in kbps.
This gives roughly 10 Mbps of outbound traffic during this interval.

$ i=0;while (($((i+=1))<=2));do /usr/sbin/lanadmin -g mibstats 0|grep -E '(In|Out)bound Octets';sleep 10;done
Inbound Octets = 1895977889
Outbound Octets = 3452238482
Inbound Octets = 1902112099
Outbound Octets = 3464719953


$ echo '(3464719953-3452238482)*8/10/1000'|bc -l
9985.17680000000000000000


Madness, thy name is system administration