devkathuria
asked on
Detremine network settings and stats
I have a requirement to programmatically determine if there is a mismatch between speed and duplex settings of a NIC and its associated switch port. I did some research and so far I am not able to find anything.
As a fall back, I am considering to get the network stats on my Windows 2000 server and in the stats if I notice issues such as collisions, packet drop or any error, I could assume that to be a network issue. My understanding is that these network stats are available only via SNMP MIB, is there any other way to get these stats programmatically?
As a fall back, I am considering to get the network stats on my Windows 2000 server and in the stats if I notice issues such as collisions, packet drop or any error, I could assume that to be a network issue. My understanding is that these network stats are available only via SNMP MIB, is there any other way to get these stats programmatically?
Ouch! Managed switches are so cheap today that (unless you are making minimum wage) you will save a fortune in buying some managed switches. Espically if this need arises more then once.
You can get adapter stats using IPHLPAPI (IP helper).
http://msdn2.microsoft.com/en-us/library/ms907329.aspx
http://msdn2.microsoft.com/en-us/library/ms907329.aspx
ASKER
I did not see something in IPHelper to get "packet drop" or collision stats. The closest I could get is GetTcpStatistics Function, but even that method does not provide above info.
MIB_IFROW (returned by GetIfEntry API) contains
dwInErrors,
dwInDiscards
dwOutErrors
dwOutDiscards
dwOutQLen
among other stats. Otherwise I think you'd be looking for a private IOCTL to send to the miniport drivers.
Check the docs on NdisRequest then.
dwInErrors,
dwInDiscards
dwOutErrors
dwOutDiscards
dwOutQLen
among other stats. Otherwise I think you'd be looking for a private IOCTL to send to the miniport drivers.
Check the docs on NdisRequest then.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.