Intel® Business Client Software Development
Support for Intel® vPro™ software development and technologies associated with Intel vPro platforms.

using AMTDiscovery.cs

peanutman0
Beginner
520 Views
I am trying to discover AMT enabled machines on a network and it looks like the AMTDiscovery.cs class from the Manageability DTK will be able to help me out here.

I am trying to call the Start method with a range of IP addresses. I am just not exactly sure how to get the discovered computer information back to the client of the class. The reportedComputers dictionaryon AMTDiscovery.csisprivate. Am I missing something? Is there another way to retrieve this information?

Am I going down the correct path to begin with? All I want to do is scan the network for AMT enabled machines and retrieve the IP Address, Host Name, Computer Model, Serial Number, and OS (not sure if you can retrieve this through the Management Engine) and store this information in a database.

I appreciate any assistance here.

0 Kudos
6 Replies
Gael_H_Intel
Moderator
520 Views
Hello Peanutman0 - thank you for posting your question on our Forum. I need to spend some time looking into this, but I had a question for you - AMTDiscovery is a public class with a whole bunch of private functions inside of it. So as long as your are in the right namespace and you are using AMTDiscovery, wouldn't you be able to call all those private functions and store off what they return to you?
The DTK stores info in the Registry, if memory serves, but that shouldn't make any differences. I will see if I can get you a better answer - I need to do some deeper investigating.
0 Kudos
peanutman0
Beginner
520 Views

Well at least it looks like I am going down the correct path using this AMTDiscovery.cs class to discover AMT enabled machines on the network.

This seems like aproblem that has likely been solved over and over again. Just want to confirm that using this class is the best way to go about it. So far I haven't been able to discover a machine that I know is AMT enabled. I will keep trying.

Thanks again!

0 Kudos
Gael_H_Intel
Moderator
520 Views
Can you veryify that you can connect to you AMT client via the webui? What kind of errors are you getting?
0 Kudos
peanutman0
Beginner
520 Views
I can connect through the webui and portqry shows the machine to be listening on port 16992. I am not getting any errors, my list is just not being populated with AMT enabled machines using the code below. Am I using this AMTDiscovery class correctly. Using the debugger the OnDiscovery event does fire for each IP address.

Is this the method that most people are using to discover machines on the network? Thanks again for your assistance!

{

List computers = new List();

AmtDiscovery discover = new AmtDiscovery();

discover.Start(IPAddress.Parse("192.168.0.1"), IPAddress.Parse("192.168.0.25"));

discover.OnDiscoveryEvent += new AmtDiscovery.AmtDiscoveryEventHandler(discover_OnDiscoveryEvent);

}

void discover_OnDiscoveryEvent(AmtDiscovery amtDiscovery, IPEndPoint ep, AmtDiscovery.AmtDiscoveryEvent e, AmtDiscovery.AmtDiscoveredComputer computer)

{

if (computer != null)

{

computers.Add(computer);

}

}

0 Kudos
Ylian_S_Intel
Employee
520 Views
Hi. Yes, you seem to be using the code correctly. I have a warning about doing this type of discovery. Basicaly, this object will try to perform a TCP connections to 16992/16993 on each IP address in the range. One of the problems with this is that Windows (Starting with XP SP2) will limit how many broken TCP connections can be attempted. So, if you scan too quickly the addresses in that range, you will get a bunch of fails and the result will not indicate anything. This is why the object is pausing between each attempt. I forget the limit, but we made it so it goes pretty slowly.

Another thing: we have a few variations of the AmtDiscovery object, one variation uses ARP to check the IP address before attempting the TCP connection. This only works in the local network. If the IP address is ourside the local network, you can't use ARP and TCP is used alone. You may find "AmtDiscovery2.cs" which is a different variation on the same discovery.

Can you tell me if Commander (Which uses this same code) works for you?

Thanks,
Ylian
0 Kudos
peanutman0
Beginner
520 Views
Yilan,

Thanks for your reply! I have now been able to successfully discover AMT machines on the network using AMTDiscovery class. As you have eluded the discovery process is kind of slow. It sounds like the AmtDiscovery2.cs class might be faster becauses it uses ARP. My understanding about ARP is that it will only discover machines for which there have been previous connections. Is that correct?

My end goal here is to discover all AMT machines on a network and store information about them in a database. Am I going down the right path here or are there better ways to do this? I am sure this has been done many times before for many different applications.

Thanks again!

Rich
0 Kudos
Reply