Operating System - HP-UX
1833555 Members
3133 Online
110061 Solutions
New Discussion

Finding a Mac Addy on our HPUX over a network. ??

 
someone_4
Honored Contributor

Finding a Mac Addy on our HPUX over a network. ??

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?

Thanks

Richard
5 REPLIES 5
Sachin Patel
Honored Contributor

Re: Finding a Mac Addy on our HPUX over a network. ??

Hi Richard
lanadmin -a 4 (4 = NetMgmtID)
Put this in to the script.

foreach system(SYSTEMS)
remsh system -n lanadmin -a 4
end

Sachin
Is photography a hobby or another way to spend $
A. Clay Stephenson
Acclaimed Contributor

Re: Finding a Mac Addy on our HPUX over a network. ??

Hi Richard,

One method is to simply arp -a.

You could also remsh to each machine and do an arp -a and capture that output.

What you really need is a reverse arp utility.
If it ain't broke, I can fix that.
MANOJ SRIVASTAVA
Honored Contributor

Re: Finding a Mac Addy on our HPUX over a network. ??

Hi Richard


Do a man arp and you will get the options .

Manoj Srivastava
Bill McNAMARA_1
Honored Contributor

Re: Finding a Mac Addy on our HPUX over a network. ??

for your local server
lanscan is the best
For network elements other hosts, printers ....
arp
Later,
Bill
It works for me (tm)
Magdi KAMAL
Respected Contributor

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. "

Good luck.

Magdi