.net - WMI instancename retrieved from performancecounter (for a network card) is not then accepted when used to retrieve counter value -


my basic problem want find total network io list of ip addresses. many of servers have different nics , have teamed nics.

since seems need have exact name network interface instance have created array of instance names:

dim category new performancecountercategory("network interface") dim instancenames string() = category.getinstancenames() 

i step through names , add list of performancecounter objects:

            each instancename in instancenames             network.add(new performancecounter())              network(i)                 .categoryname = "network interface"                 .countername = "bytes total/sec"                 .instancename = instancename                 .machinename = ip_address             end              try                 network_usage = network_usage + network(i).nextvalue()             catch ex exception              end try              = + 1         next 

the problem names generated first part of code raise exception when try next value: "instance 'local area connection* 12' not exist in specified category."

the names retrieved seem different names used when looking @ perfmon on particular server, not sure if matters though


Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -