------art_49336_15855790.1222264736326
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

On Thu, Sep 18, 2008 at 9:08 PM, Jeff Moore <jcmoore / pressenter.com> wrote:

> Glen Holcomb wrote:
> > On Thu, Sep 18, 2008 at 2:09 PM, Glen Holcomb <damnbigman / gmail.com>
> > wrote:
> >
> >> I've tried a generic ICMP packet but that doesn't work under Windows
> with
> >> the standard Ruby build and I don't have the tools/time to build it my
> self
> >> under Windows.
> >>
> >> --
> >> "Hey brother Christian with your high and mighty errand, Your actions
> speak
> >> so loud, I can't hear a word you're saying."
> >>
> >> -Greg Graffin (Bad Religion)
> >>
> >
> > Here is the full method if anyone wants more context:
> >
> >   # Lets find MAC addresses for the machines in the list
> >   def find_macs
> >     # This technique will only give MAC addresses for the machines on
> > our
> > subnet.
> >     #    However since those are the only ones we can wake it doesn't
> > really
> > matter.
> >     #    It is nasty slow and a better way should be found some day.
> >
> >     DB[:computers].each do |computer|
> >       begin
> >         Net::PingExternal.new(computer[:name]).ping
> >       rescue SocketError exception
> >         next
> >       end
> >     end
> >
> >     arp_table  arp -a`.split("\n")[2..-1]
> >
> >     arp_table.each do |address|
> >       full_name  ocket.gethostbyname(address.split(' ')[0])
> >
> >       comp  omputer.find :name full_name.split('.')[0]
> >       comp.mac  ddress.split(' ')[1].gsub!('-', ':')
> >       comp.save
> >     end
> >     close()
> >   end # find_macs
>
>
> NMap is very fast and comes in a WinDoze flavor.
>
> Since you're already mashing up the arp output,
> I assume you will have no qualms about doing the
> same for NMap output.
>
> Not a pure Ruby solution but then NMap is open source
> so if you're really into purity you could transcribe it's
> approach to WinDoze discovery (maybe...possibly...)
>
> But if expedience is the order of the day...
>
> http://nmap.org/
>
> You'll need WinPCap as well (the packet capture lib)
>
> http://www.winpcap.org/
>
> djief
> --
> Posted via http://www.ruby-forum.com/.
>
>
Thanks Jeff,

Although it looks like both parsing arp and the External ping are causing me
other problems.  With over 900 machines to check the app keeps borking with
too many open files.  So it would appear I need to find another way to
acquire MAC addresses.

-- 
"Hey brother Christian with your high and mighty errand, Your actions speak
so loud, I can't hear a word you're saying."

-Greg Graffin (Bad Religion)

------art_49336_15855790.1222264736326--