Logic Machine Forum
mdns network scan - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: mdns network scan (/showthread.php?tid=3751)



mdns network scan - hummelsystemhaus - 15.12.2021

Hello all,
I need a list of hostnames in a local network.
The linux tool mdns-scan would do the job, but I wasn´t able to install it on a LogicMachine5.
Has anyone tried to use mdns-scan, Avahi or a different tool at the LogicMachine5 platform?


RE: mdns network scan - Daniel - 15.12.2021

Why don't you just click here
   
LM is already using avahi


RE: mdns network scan - Erwin van der Zwart - 15.12.2021

Nice HW collection (:


RE: mdns network scan - admin - 16.12.2021

Use this, change _http._tcp to the required service name.

Code:
avahi = io.readproc('avahi-browse _http._tcp')
lines = avahi:split('\n')

for _, line in ipairs(lines) do
  ip, port, name, descr = unpack(line:split('\t'))
  if descr then
    log(ip, port, name, descr)
  end
end