On Sun, 2002-09-29 at 23:27, Stephen Liu wrote: > Hi All Folks > > From "network config" on client's machine, his MAC address can be > found. But if there are more than 40 clients scattering on several floors, > looking at all clients' machines will take some time. > > Any folk on the list knows a quick way to find MAC addresses of all clients > without going around to each client?
Here's an outline of one way to do it: Set RUNLEVEL=4 as the default in /opt/ltsp/i386/etc/lts.conf. This ensures that new machines start in text mode, running on the server. Set RUNLEVEL=5 for each existing machine in .../lts.conf. This will allow terminals you know about to start in graphical mode. Create a new user, "SETUP". SETUP's .bash_profile will ask a series of questions in plain, everyday language, such as "Where is the terminal you are using now?" or "Whose terminal are you using right now?". The answers get logged, along with the output from `who am i`, in a text file in SETUP's home directory. The SETUP user is then logged out. Give all This script is NOT PORTABLE BETWEEN DISTRIBUTIONS. You will need to make changes to it to match the output from your system. Also, remember that this is a VERY ROUGH OUTLINE of how you might collect the information you want. First draft of /home/SETUP/.bash_setup: ################################################## #!/bin/bash PATH=/sbin:$PATH # make sure SETUP can run 'arp' WHO=`who am i` HOSTNAME=`echo $WHO | cut -d\( -f2 | cut -d\) -f1` ARP=`arp -a $HOSTNAME` MAC=`echo $ARP | cut -d\) -f2 | cut -c5-21` LOGFILE=/home/SETUP/`echo $MAC | sed -e "s/:/_/g"` read -p "Where is this terminal? " LOCATION read -p "Who's terminal is this? " OWNER echo $MAC > $LOGFILE echo $WHO >> $LOGIFLE echo $ARP >> $LOGFILE echo $OWNER >> $LOGFILE echo $LOCATION >> $LOGFILE logout ################################################## # samples from my machine, to help you adjust this to yours: # WHO=ltspserver.test.net!username pts/5 Sep 30 10:20 (ws001.test.net) # HOSTNAME=ws001.test.net # ARP=ws001.test.net (192.168.0.1) at 00:09:AB:9B:C3:C7 [ether] on eth0 # MAC=00:09:AB:9B:C3:C7 # LOGFILE=00_09_AB_9B_C3_C7 ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _____________________________________________________________________ Ltsp-discuss mailing list. To un-subscribe, or change prefs, goto: https://lists.sourceforge.net/lists/listinfo/ltsp-discuss For additional LTSP help, try #ltsp channel on irc.openprojects.net
