Re: [opensuse] How to find list of hosts on local subnet?



I generally do something like this:

for host in 10.1.0.{1..254}; do fping $host; done


Thanks,
James


On Fri, Dec 3, 2010 at 2:14 AM, Per Jessen <per@xxxxxxxxxxxx> wrote:
David C. Rankin wrote:

Guys,

What would I use to get a list of hosts on the local subnet aside from
dumping the forward zone in bind or doing a ping -c .1 subnet.1-254? I
want to find something I can call from a script to return the list to
either a single variable or an array.

I'm open to anything, but would prefer a BASH or c solution.

The arp variations already suggested are probably enough, but if you're
on the dhcp machine, you could take a look at the dhcp lease file.
(assuming you already know about the "fixed" hosts).


--
Per Jessen, Zürich (-3.9°C)

--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx


--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx



Relevant Pages

  • Re: Button list control
    ... can load all DLL's, found in a given directory, and the plug-ins will register themselves for further use. ... Implementing 7zip, or some other new compression format, only requires to add the according DLL to the app's directory. ... The host application can ... the user's commands and parameters back to the plugin. ...
    (comp.lang.pascal.delphi.misc)
  • Re: remsh a function in the current script
    ... Assuming your shell on the remote host is ksh, ... If your shell on the remote host isn't ksh, ...
    (comp.unix.shell)
  • !!! Path to docroot not valid: public
    ... We are working on an application which is hosted on Slice. ... The application was previously working fine but the host went down. ... I have tried the following commands by logging in as root. ... Path to pid file not valid: ...
    (comp.lang.ruby)
  • Re: I have 100 servers which need a new backup server added to a text file, and then the backup agen
    ... for host in hosts: ... for cmd in commands: ... Shell has its uses. ... only add new line to config-file if it isn't present ...
    (comp.lang.python)
  • /etc/resolv.conf advice
    ... If I edit resolv.conf to manually input my ISPs DNS server, all commands ... resolv.conf entry is reset by DHCP to 192.168.2.1. ... What has happened to stop host and dig resolving using 192.168.2.1? ...
    (uk.comp.os.linux)