Operating System - HP-UX
1833683 Members
3839 Online
110062 Solutions
New Discussion

Re: N/w stats through lanadmin for virtual ip addresses

 
SOLVED
Go to solution
Ninad_1
Honored Contributor

N/w stats through lanadmin for virtual ip addresses

Hi,

I am trying to collect network statistics for one of my servers which is a node in a cluster and hence has virtual ip addresses used for the packages.
I am using lanadmin -g mibstats PPA# | grep -i octets
to get the input and output bytes transferred count.
Now if I give the PPA# as the virtual port no e.g. 1:1 for lan1:1 then it gives error "Invalid PPA Number entry"
Why is it so ? How can I get the stats for the traffic thru the virtual ip address.
I know that the traffic will finally go thru the same port i.e. lan1,lan1:1 and lan1:2 traffic will finally go thru lan0 port only, but I want to know the stats for each virtual interface individually. How can I find out this?
If I do a netstat -in - it shows stats for each virtual port - but it is in packets so I dont know how that relates to bytes. So why not lanadmin can gives similar results.

Outputs
lanscan
Hardware Station Crd Hdw Net-Interface NM MAC HP-DLPI DLPI
Path Address In# State NamePPA ID Type Support Mjr#
0/2/0 0x00306E032E8D 16 UP lan16 snap16 1 ETHER Yes 119
1/0/0 0x00108327B55B 1 UP lan1 snap1 2 ETHER Yes 119
7/2/0 0x00306E032E82 15 UP lan15 snap15 3 ETHER Yes 119
2/0/0 0x00108327A5CF 2 UP lan2 snap2 4 ETHER Yes 119
3/0/0 0x00108327B54C 4 UP lan4 snap4 5 ETHER Yes 119
4/0/0 0x00108327A5A5 0 UP lan0 snap0 6 ETHER Yes 119
5/0/0 0x0060B0582028 3 UP lan3 7 FDDI Yes 119
7/0/0 0x00108327B57A 20 UP lan20 snap20 8 ETHER Yes 119

netstat -in
Name Mtu Network Address Ipkts Opkts
lan3 4352 10.221.40.0 10.221.40.92 2420813607 1200141110
lan2* 1500 none none 0 0
lan1:1 1500 10.221.51.0 10.221.51.98 25650528 42192
lan1 1500 10.221.51.0 10.221.51.92 1373617673 1660757230
lan0 1500 10.221.11.0 10.221.11.92 778319 491294
lo0 4136 127.0.0.0 127.0.0.1 35288772 35288820
lan15 1500 192.168.3.0 192.168.3.92 2 2
lan1:2 1500 10.221.51.0 10.221.51.87 50580167 49574385
lan4* 1500 none none 0 0
lan20 1500 10.221.55.0 10.221.55.92 329147208 140013030

lanadmin -g mibstats 1 | grep -i oct
Inbound Octets = 3356871557
Outbound Octets = 2391383620
lanadmin -g mibstats 1:2 | grep -i oct
Invalid PPA Number entry

Thanks,
Ninad
11 REPLIES 11
RAC_1
Honored Contributor

Re: N/w stats through lanadmin for virtual ip addresses

You can not do that. You can get stats only for physical interface. Check netstat -in and in and out packets. That may help you.

Also, you may want to check MWA stats. But I think, that will also give stats for physical NIC and not virtual.
There is no substitute to HARDWORK
Ninad_1
Honored Contributor

Re: N/w stats through lanadmin for virtual ip addresses

Anil,

Is there no other way than netstat -in ?
OK, then can you tell me what is the relation between the pkts and bytes, as netstat -in shows the stats in Input and output packets, how do I determine the traffic in bytes ?

Thanks,
Ninad
RAC_1
Honored Contributor

Re: N/w stats through lanadmin for virtual ip addresses

What you see in netstat -in is in packets. one packet is equal to MTU of NIC.
There is no substitute to HARDWORK
Chan 007
Honored Contributor

Re: N/w stats through lanadmin for virtual ip addresses

Ninad,

Try netstat -p tcp or , this gives conversion in bytes.

If you need a specific interface then try
netstat -I lan0

Chan

Ninad_1
Honored Contributor

Re: N/w stats through lanadmin for virtual ip addresses

Anil,

1. The MTU size as I understand is the maximum transfer size and not nessecary that each packet transmitted or received is of that size only - it can be less than that as well. Please correct me if I am wrong.
So how do I map packets to bytes ?

2. How do you people check network statistics for a server ? If not able to do at switch level and need to do this at server level?
3. What do you do for the virtual interfaces ?
4. How will you calculate net stats for each configured SG package ?


Chan,

The commands you mentioned again give stats either for the physical interface [ netstat -I] or overall TCP [ netstat -p ] , but what I want to understand really is how much traffic is there for each SG package using the different virtual ips.

Thanks,
Ninad
RAC_1
Honored Contributor

Re: N/w stats through lanadmin for virtual ip addresses

Then you will have to get MWA stats. check all metrics available in /var/opt/perf/reptall. Use extract command to extract the data you want. (But again, you will get stats for physical NIC and not virtual)
There is no substitute to HARDWORK
Ninad_1
Honored Contributor

Re: N/w stats through lanadmin for virtual ip addresses

Anil/All,

Would you be able to provide any inputs on the above quries?

Thanks,
Ninad
Steve Lewis
Honored Contributor

Re: N/w stats through lanadmin for virtual ip addresses

If you have iptables you can count the packet stats in chains. Does that help?

# iptables -L -v | grep Chain
Chain INPUT (policy ACCEPT 4847376 packets, 20383636 bytes)
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
Chain OUTPUT (policy ACCEPT 993837 packets, 69736376 bytes)

I think may be stuck with packets-only. But bearing in mind the finite number of packets per second, based on 10/100/1000mbits, the ratio of packet types you can get from netstat -s, the actual number you are receiving in netstat -i, add this to the traffic you also get on your main (non-virtual) interface, you can get an upper-limit on the volume of traffic and a likely lower-limit.

Bear in mind that packets go out from the base interface (source IP != your virtual IP) by default.

You could also try to segment your IP usage more by ensuring that local connections use a different hostname, therefore a different IP, therefore the stats get routed elsewhere. For example, my informix database accepts connections locally and remotely by hostname/IP. Database traffic bumps up the packet stats of whichever interface is connected through, including local users. I just proved this by testing a test data copy from one instance to another on the same machine, initiated locally, but communicating over a normally quiet lan. The packet stats went up by about 5000 a second.

In the end, I think you may get the most accurate stats by querying your firewall.



RAC_1
Honored Contributor
Solution

Re: N/w stats through lanadmin for virtual ip addresses

1. The MTU size as I understand is the maximum transfer size and not nessecary that each packet transmitted or received is of that size only - it can be less than that as well. Please correct me if I am wrong.
So how do I map packets to bytes ?
>>You are correct. You really can not do that.

2. How do you people check network statistics for a server ? If not able to do at switch level and need to do this at server level?
>>If not at switch level, we do it with MWA metrics for individual NICs. There are many metrics in /var/opt/perf/reptall. Set it to what you want and run extract to get required data. man extract for details. Basically, you need to as follows.
extract -v -gapkdztncuyGADZTNUY -r "rept_file" -s "start_date_time" -e "end_date_time" -f out_put_file
3. What do you do for the virtual interfaces ?
>>All the data that flows through virtual interface is basically going through physical NIC. So does it matter. I have no clue how one would do this.
4. How will you calculate net stats for each configured SG package ?
>>Again, each package will be basically a physical NIC. So again use extract with required NICs
There is no substitute to HARDWORK
Ninad_1
Honored Contributor

Re: N/w stats through lanadmin for virtual ip addresses

I think I have to go with stats for physical interface only. What I was intending to do was to understand the stats on n/w usage by each package, anyway I have to settle down with physical port stats.

Thanks all,
Ninad
rick jones
Honored Contributor

Re: N/w stats through lanadmin for virtual ip addresses

As already pointed-out, lanadmin provides stats for the "physical" interface. That might be more accurately put as the "data-link" as it will IIRC also work for a VLAN interface.

A logical interface (eg lan1:1) is purely a figment of the transport's imagination (ie IP and above). The data link knows nothing about it.

That leaves netstat.

However... IP should have an "interface MIB" for that logical interface, and one could query that via SNMP calls - assuming of course an SNMP server were running on the system.

I'm sure there are other calls one can make - as in what Glance/Measureware might do, but I'm not sure they are "documented" for end-user use, so if you do go grubbing around in the include files keep that in mind. Might be worth checking pstat()'s manpage...
there is no rest for the wicked yet the virtuous have no pillows