Simpler Navigation for Servers and Operating Systems - Please Update Your Bookmarks
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
If you have bookmarked forums or discussion boards in Servers and Operating Systems, we suggest you check and update them as needed.
Networking
cancel
Showing results for 
Search instead for 
Did you mean: 

How to query how many bytes the ethernet card receives and sends on HP-UX?

Wang Fenglong
Occasional Visitor

How to query how many bytes the ethernet card receives and sends on HP-UX?

Hi admins, please help me out with some command or method which i can retrieve how many bytes the ethernet card have received and sent in HP-UX, "netstat -in" only gives me the number in packets, but i need the number in bytes, is there any command can be used in a shell to retrieve these statistic values directly? such as "entstat" in AIX, the "/proc/net/dev" in Linux.

Thank u very much for any help, it is quite urgent.
5 REPLIES
Horia Chirculescu
Honored Contributor

Re: How to query how many bytes the ethernet card receives and sends on HP-UX?

You could use Netperf:

http://www.netperf.org

You can get compiled binaries from porting archive:

http://hpux.connect.org.uk/hppd/hpux/Networking/Admin/netperf-1.7.1/

Horia.
Best regards from Romania,
Horia.
Kapil Jha
Honored Contributor

Re: How to query how many bytes the ethernet card receives and sends on HP-UX?

I do not think you can get the value from UNIX end, because packets are not of same length.

MAximum bytes you can get like
Ipkts (from netstat -in)*MTU=bytes

MTU is maximum transmission unit.

to get the actual value you would need third party tools.

BR,
Kapil+
I am in this small bowl, I wane see the real world......
Horia Chirculescu
Honored Contributor

Re: How to query how many bytes the ethernet card receives and sends on HP-UX?

Regarding Munin:

http://munin-monitoring.org/

It seems that the plugin for HP-UX also uses netstat -in as the source of the data.

See

http://munin-monitoring.org/browser/trunk/node/node.d.hp-ux/netstat_rate_tcp_.in?rev=1404

Horia.
Best regards from Romania,
Horia.
Matti_Kurkela
Honored Contributor

Re: How to query how many bytes the ethernet card receives and sends on HP-UX?

"lanadmin -g " outputs "Inbound Octets" and "Outbond Octets" which are the amounts of data transferred in bytes (octet = byte).

The is the number of the LAN interface, which can be determined from the "lanscan" output. Usually, for the interface lanN, the equivalent PPA is simply N.

Example:
To get the traffic statistics of lan1:

# lanadmin -g 1

LAN INTERFACE STATUS DISPLAY
Wed, Mar 24,2010 15:01:27

PPA Number = 1
Description = lan1 HP PCI-X 1000Base-T Release B.11.31.0709.
01
Type (value) = ethernet-csmacd(6)
MTU Size = 1500
Speed = 1000000000
Station Address = 0x110a42adb6
Administration Status (value) = up(1)
Operation Status (value) = up(1)
Last Change = 267
Inbound Octets = 2940170422
Inbound Unicast Packets = 2830375214
Inbound Non-Unicast Packets = 22790734
Inbound Discards = 0
Inbound Errors = 0
Inbound Unknown Protocols = 6515494
Outbound Octets = 2989997330
Outbound Unicast Packets = 85267744
Outbound Non-Unicast Packets = 35162
Outbound Discards = 0
Outbound Errors = 0
Outbound Queue Length = 1
Specific = 655367

Ethernet-like Statistics Group

Index = 2
Alignment Errors = 0
FCS Errors = 0
Single Collision Frames = 0
Multiple Collision Frames = 0
Deferred Transmissions = 0
Late Collisions = 0
Excessive Collisions = 0
Internal MAC Transmit Errors = 0
Carrier Sense Errors = 0
Frames Too Long = 0
Internal MAC Receive Errors = 0

In HP-UX 11.31 (and above), you should use nwmgr instead. Example for lan1:

nwmgr --st mib -c lan1
*** lan1 64 bit MIB statistics:
Interface Name = lan1
PPA Number = 1
Description = lan1 HP PCI-X 1000Base-T Release B.11.31.0709.01
Interface Type = 1000Base-T
MTU Size = 1500
Speed = 1 Gbps
Station Address = 0x00110A42ADB6
Administration Status = UP
Operation Status = UP
Last Change = Sat Oct 31 22:56:05 2009
Inbound Octets = 204804034642
Inbound Unicast Packets = 2830377326
Inbound Multicast Packets = 0
Inbound Broadcast Packets = 22792187
Inbound Discards = 0
Inbound Errors = 0
Inbound Unknown Protocols = 6515719
Outbound Octets = 11580353438
Outbound Unicast Packets = 85270743
Outbound Multicast Packets = 0
Outbound Broadcast Packets = 35162
Outbound Discards = 0
Outbound Errors = 0
Counter Discontinuity Time = Sat Oct 31 22:56:04 2009
Physical Promiscuous Mode = FALSE
Physical Connector Present = TRUE
Interface Alias =
Link Up/Down Trap Enable = Enabled

MK
MK
rick jones
Honored Contributor

Re: How to query how many bytes the ethernet card receives and sends on HP-UX?

Lanadmin, as previously mentioned, is the way to go. Also, glance has a way to do the same thing.

As for netperf, it is a generator of load, not simply a reporting tool, so it would not be indicated. And, that version listed is positively ancient. netperf is up to version 2.4.5 from netperf.org.
there is no rest for the wicked yet the virtuous have no pillows