Maintenance

  • Home
  • Log in
  • « LDAP authentication troubleshooting
  • Wine issues fixed after OS reinstall »

Finding IP addresses of DHCP machines

Posted by gregster on 08 Oct 2010 in Labs, Activity log, Activity log

In order to run rsnapshot I need either an IP name (e.g. unix.uvic.ca) or an IP address. This is because ultimately, rsnapshot runs an rsync command, which needs one of those IDs to get in to the client.

I investigated a number of tools that *should* be able to do this, but had no luck. So, my home-brew method goes like this:
1) install nmap
2) run this (all on one line):
nmap -sP 142.104.196.192/26|arp -na|grep -v "incomplete"|sed 's/\? (//g'|sed 's/) at/\t/g'|cut -d "[" -f1

You'll get back a tab-delimited result with IP address first followed by the MAC address of each responsive machine.

Ultimately, this will help construct a script that can be run from rutabaga that will build an up-to-date hosts file.

update: I've created such a script, using the collected MAC addresses of HCMC machines and storing them as variables. I then use sed to swap out MAC addresses for machine names. Seems to work well.

This entry was posted by Greg and filed under Labs, Activity log, Activity log.

Maintenance

This blog is the location for all work involving software and hardware maintenance, updates, installs, etc., both routine and urgent.
  • Home
  • Recently
  • Archives
  • Categories

Search

Categories

  • All
  • Announcements
  • Hit by a bus
  • Labs
    • Activity log
    • Documentation
  • Notes
  • R & D
    • Activity log
    • Documentation
  • Servers
    • Activity log
    • Documentation
  • Tasks

All blogs

  • Academic
  • AdaptiveDB
  • Admin
  • Announcements
  • CanMys
  • Cascade
  • CGWP
  • ColDesp
  • Depts
  • DVPP
  • Endings
  • HCMC Blogs
  • Landscapes
  • LEMDO
  • Linguistics
  • Maint
  • LondonMap
  • Mariage
  • MoM
  • Moses
  • Pro-D
  • Projects
  • ScanCan
  • HumsSites
  • Wendat

This collection ©2025 by admin • Help • CMS + email marketing