We have a linux-based networking product (call it "Z") and we tend to sell them in batches so that they all run on the same subnet doing the same kinds of stuff and reporting data back to a single server (also on the subnet) that coordinates them all.
The units are running a custom, homebrew version of Linux based on a 2.6 kernel.
I have been asked to look into the possibility of adding the following feature:
"Any Z unit must be able to find other Z units on the local subnet and list their IPv4 addresses. The list must not include other unrelated computers present on the local subnet."
- User can
sshinto any arbitrary Z unit and issue a command (could be a new bash script) called "listLocalSiblings".
- The Z unit will investigate the local network vicinity and output a simple textual list of the IP addresses of ONLY the other Z units...
There may be multiple unrelated devices on the subnet running various operating systems. I would like this to be as passive as possible (eg. avoid port scanning or having a listener waiting for and responding to special "pings").
Is there a generic way under Linux to categorise networked devices?
I do have the luxury of adding new software to the product but if there is a way to do this based on some kind of intrinsic signature that each machine might have, that would be preferable. We have never tried to make these machines "see" each other before without actually hard-coding pathways for them to find each-other.
Edit: for various reasons, we cannot obtain this info from the server. For now, assume the server has crashed or the ethernet cable has been pulled out of the back of it.
The list is then shown to the user for her to do with as she pleases.
The Z devices are roughly all the same hardware although the older ones have older versions of the Linux system and older motherboards and NICs as you'd expect.
Ideally it would be nice to just drop a bash script on each unit and run it, but I don't know enough about networking tools to know if this is a realistic prospect.