Operating System - HP-UX
1830498 Members
2187 Online
110006 Solutions
New Discussion

measuring lan speed without glance

 
SOLVED
Go to solution
John Lipsitz
Occasional Contributor

measuring lan speed without glance

How can I measure lan speed (throughput) without having glance installed ? I can use ftp to see the speed, just want to monitor it during the working day.
8 REPLIES 8
Stefan Farrelly
Honored Contributor
Solution

Re: measuring lan speed without glance

Use this script;

export HOSTNAME=$(hostname)
let z=0
let y=$(lanadmin -g mibstats 0|grep -i oct|grep Inbound|awk '{print $4}')
let y2=$(lanadmin -g mibstats 0|grep -i oct|grep Outbound|awk '{print $4}')
while true
do
let x=0
sleep 1
x=$(lanadmin -g mibstats 0|grep -i oct|grep Inbound|awk '{print $4}')
x2=$(lanadmin -g mibstats 0|grep -i oct|grep Outbound|awk '{print $4}')
let t=$x-$y
let t2=$x2-$y2
let y=$x
let y2=$x2
let z=$z+1
let t=$t/1000
let t2=$t2/1000
echo "${t} Kb/s inbound into $HOSTNAME, ${t2} Kb/s outbound from $HOSTNAME"
done
Im from Palmerston North, New Zealand, but somehow ended up in London...
John Lipsitz
Occasional Contributor

Re: measuring lan speed without glance

It doesnt work on my server. Just get syntax errors.
Stefan Farrelly
Honored Contributor

Re: measuring lan speed without glance

You need to identify the nmid for your lancard. It wont work on a 10Mb card, only a 100Mb+ card. For example, if you nmid (from lanscan/lanadmin) is 1 then change all lines;

lanadmin -g mibstats 0
to
lanadmin -g mibstats

Im from Palmerston North, New Zealand, but somehow ended up in London...
Ralph Grothe
Honored Contributor

Re: measuring lan speed without glance

John,

though basically not much different from Stefan's solution, if you have Perl you could use the attached script.
To find out about its usage try

$ perldoc /path/where/this/script/was/copied_to


If your box isn't a MC/SG cluster and you know wich NIC's mibstats to query anyway, just change the line of code where the assignment to something like

my $prim_nic = 2;

if your NIC was say lan2.
Madness, thy name is system administration
Suresh Patoria
Super Advisor

Re: measuring lan speed without glance

Hi,

Use the netstat -in command

Thanx
ines coronado_2
New Member

Re: measuring lan speed without glance

Hello I use the attached script using as argument the nmid of the lan card
Geoff Wild
Honored Contributor

Re: measuring lan speed without glance

Here's another script - output like:

# lan-thru-put
Started - Wed Nov 19 06:53:24 MST 2003

Iterations remaining: 1 ; Collection time: 60 seconds

Collecting data ...

Finished - Wed Nov 19 06:54:24 MST 2003

Interface IP Address Hostname InPkts OutPkts KbIn/Sec KbOut/Sec TtlKb/Sec
============================================================================================
lan4* none none 0 1 0 0 0
lan5 156.44.59.39 pc0004f 0 0 0 0 0
lan2:1 156.44.176.32 156.44.176.32 0 0 0 0 0
lo0 127.0.0.1 localhost 0 0 0 0 0
lan1 156.44.44.182 pc0004hb 0 2 0 0 0
lan5:1 156.44.59.32 iqadbcif 0 0 0 0 0
lan2 156.44.176.28 pc0004 0 0 0 0 0
lan3* none none 0 0 0 0 0


Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Alzhy
Honored Contributor

Re: measuring lan speed without glance

I used this as a simple, real-life and effective way to measure bandwidth performance and dispel any issues that "it is your disks that are slow"...

Open an FTP session with another server (Solaris or HPUX 11.11) and invoke the following:

put "|dd if=/dev/zero bs=32k count=1000" /dev/null

And here are the expected 1 way bandwidth on a switched environment:

100BT - 8-10 MBytes/sec
1000BT - 20-40 Mbytes/sec (dependent on CPU)
1000SX - 30-60 Mbytes/sec. (again dependent on CPU)
FCIP/IPFC (ie. JNI Cards running IP)
- 40-60 Mbytes/sec. sustained

Hakuna Matata.