Is there a script or command that can find a mac address over our network? I need to find a certain mac addy and know what hostname it sits on without having to telnet in everybox. And looking at each nic one by one. All of our boxes are trusted so I can do a remsh to all of them. Any one have any ideas?
Re: Finding a Mac Addy on our HPUX over a network. ??
Hi Richerd,
Your script is the following :
#Create a file including all your servers names one per line in /tmp/serversNames for example.
mac= // replace the name with your mac address serversNames=`cat /tmp/serversNames`
for currentServer in $serversNames do currentMac=`remsh $currentServer -l root -n "/usr/sbin/lanscan" ? grep $mac`
if [[ $currentMac != "" ]] then lan=`awk '{print $5}'` ip=`remsh $currentServer -l root "/usr/sbin/ifconfig $lan" ? awk '{print $2}' ? grep -v "flags"` echo "### Mac address : '$mac' is on server '$currentServer' for ip address '$ip'. "
exit 0 fi done
echo " !!! this mac $mac is not belonging to these servers $serversNames. "