- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Are there any calls to get network speed?
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2006 06:52 PM
06-27-2006 06:52 PM
I am writing C program to get networkspeed and collissions..etc. I know that from `netstat -i` I will get this information. But, for better programming I wanted to get from some calls(system/network). Even in hpbtlanconf file also this has not hardcoded. Can you please help me out.
Thanx in Advance
-shivu
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2006 12:57 PM
06-28-2006 12:57 PM
Re: Are there any calls to get network speed?
Or you can use the system() system call and parse lanadmin output.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2006 04:47 PM
06-28-2006 04:47 PM
Re: Are there any calls to get network speed?
I scan dlpi.h file. There I couldn't find speed variables.. As well If I can take from system() of lanadmin, how can I pass the values simultaneously.
As you know lanadmin will throw menu, and Enter command prompt. Like the below
lan = LAN Interface Administration
menu = Display this menu
quit = Terminate the Administration
terse = Do not display command menu
verbose = Display command menu
Enter command:lan
Then It will throw
clear = Clear statistics registers
display = Display LAN Interface status and statistics registers
end = End LAN Interface Administration, return to Test Selection
menu = Display this menu
ppa = PPA Number of the LAN Interface
quit = Terminate the Administration, return to shell
reset = Reset LAN Interface to execute its selftest
specific = Go to Driver specific menu
Enter command:display
Now we will get the required informayion.
Now I need to put all these lanadmin, lan and display. so that I will get the required information.
Please guide me how can I give all these command in one shot and execute.
-shivu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2006 05:01 PM
06-28-2006 05:01 PM
Solutionhttp://forums1.itrc.hp.com/service/forums/bizsupport/questionanswer.do?threadId=473449
http://forums1.itrc.hp.com/service/forums/bizsupport/questionanswer.do?threadId=24481
Hope this helps.
-Amit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2006 06:50 PM
06-28-2006 06:50 PM
Re: Are there any calls to get network speed?
It so only behaves when it isn't passed any arguments.
For instance if you want to get the speed and mode of the NIC lan1 you could run
$ /usr/sbin/lanadmin -sx 1
Speed = 100000000
Current Config = 100 Full-Duplex AUTONEG
If you don't find a better solution through some system lib (sorry, am no C systems hacker), or syscall, you could maybe wrap the above in an sys() or exec*() call.
Besides, what about SNMP?
You could install the free net-snmp suite and query the NICs' MIB stats from any node.
Only take two queries and devide by the interval to get a very crude interpolation of the packet rates.
Then from the MTU setting you could estimate the Byte rates.
You could even get the counters of inbound and outbound packets from a lanadmin call
$ /usr/sbin/lanadmin -g mibstats 1|awk -F= '/(In|Out)bound Octets/{print$NF}'
61706455
17558433
Of course you wouldn't do the parsing with an external awk call like above.
I've put something similar in a Perl script which has built-in parsing power.
HTH
Ralph
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2006 04:24 AM
06-29-2006 04:24 AM
Re: Are there any calls to get network speed?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2006 01:03 PM
06-29-2006 01:03 PM
Re: Are there any calls to get network speed?
echo "lan \n ppa 1 \n display \n quitâ | lanadmin
lanadmin can take stdin as input so anything you can type into the menu, you can put on a single line and use a system() call to get the results.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2006 01:05 PM
06-29-2006 01:05 PM
Re: Are there any calls to get network speed?
lanadmin -g mibstats
instead