Quick and dirty Sinatra app for SNMP polling an Apple Airport Express base station to see who's online. YMMV
smnpwalk
nmap
for MAC prefix databasedig
for Zeroconfping
to test for host online
- Make a file called
hosts
with MAC address or host in the left hand field, then a space and a free-form comment
DE:AD:BE:EF:12:34 Raspberry Pi 1
10.10.42.2 Raspberry Pi 1
DE:AD:BE:EF:12:34 Power Mac G4
DE:AD:BE:EF:12:34 Thinkpad
bundle install
- Run
ruby app.rb IPADDRESS_OF_AIRPORT
and navigate to http://localhost:4567/
host | ip address | mac address | vendor | comment | zeroconf |
---|---|---|---|---|---|
raspberry pi 1 | 10.10.32.3 | DE:AD:BE:EF:12:34 | alfa | wireless | raspberrypi.local. |
10.10.32.6 | DE:AD:BE:EF:12:34 | raspberry | ethernet | ||
melvin's macbook | 10.10.32.8 | DE:AD:BE:EF:12:34 | apple | melvin.local. "model=macbookpro3,3" "osxvers=7" |
|
Mac Mini | 10.10.32.9 | DE:AD:BE:EF:12:34 | liteon | ||
Pentium PC! | 10.10.32.10 | DE:AD:BE:EF:12:34 | intel | wireless | windowsxp.local. |
10.10.32.103 | DE:AD:BE:EF:12:34 | wistron | ethernet | ||
jon iphone | 10.10.32.100 | DE:AD:BE:EF:12:34 | apple | ||
tom iphone | 10.10.32.101 | DE:AD:BE:EF:12:34 | apple | ||
tom imac | 10.10.32.102 | DE:AD:BE:EF:12:34 | apple | tom-imac.local. |
This should probably be run by cron instead of running in the server. Those slow dig calls could be parallelized with a better language.
- Historical info (lastlog)
- Machines stick around for a long time (DHCP lifetime?)
- non-DHCP hosts?