On Sun, 09 Sep 2007 07:24:44 +0000, usenet wrote: > On Sep 8, 4:52 pm, [EMAIL PROTECTED] wrote: >> How would I make a script that gets a list of all the computer names >> and ip addresses, internal 192.168..., of the computers attached to my >> wired network? Or is there a program that will do this already? Thanks > > There is already such a program: who
Which who program is that? The one I'm familiar with only looks at logged-in users, not network scans: NAME who - show who is logged on SYNOPSIS who [OPTION]... [ FILE | ARG1 ARG2 ] DESCRIPTION -a, --all same as -b -d --login -p -r -t -T -u -b, --boot time of last system boot -d, --dead print dead processes -H, --heading print line of column headings -l, --login print system login processes --lookup attempt to canonicalize hostnames via DNS -m only hostname and user associated with stdin -p, --process print active processes spawned by init -q, --count all login names and number of users logged on -r, --runlevel print current runlevel -s, --short print only name, line, and time (default) -t, --time print last system clock change -T, -w, --mesg add user's message status as +, - or ? -u, --users list users logged in You can see which hosts have active connections to this one with netstat, but it can include hosts outside the LAN. You can see recent connections to or from the LAN in the arp cache. You can exhaustively ping every possible address, although they are not obliged to respond. Otherwise, if you're using DHCP, you can ask the DHCP server for a list of current leases. > You may need to do an nsloopup on the hostnames to get the IP address, > depending on your environment. Ahem. nslookup. But trivially implemented in Perl via the gethostbyname/gethostbyaddr functions. -- Peter Scott http://www.perlmedic.com/ http://www.perldebugged.com/ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/